[ 
https://issues.apache.org/jira/browse/MYNEWT-2?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Sterling Hughes resolved MYNEWT-2.
----------------------------------
    Resolution: Fixed

This was added in the larva/sys/log package.

You can create a log, which can point to either: 

- Circular memory buffer
- Console

The log is encapsulated by the: 
struct log {
    char *l_name;
    struct log_handler *l_log;
    uint16_t log_level;
    STAILQ_ENTRY(log) l_next;
};

Log structure.  

#define LOG_DEBUG(__l, __mod, __msg, ...) 
#define LOG_INFO(__l, __mod, __msg, ...) 
#define LOG_WARN(__l, __mod, __msg, ...)
#define LOG_ERROR(__l, __mod, __msg, ...)
#define LOG_CRITICAL(__l, __mod, __msg, ...)

These macros are used to log errors to the log given by __l, for the module 
given by __mod with message __msg, and an optional set of arguments given to 
printf() for __msg.  



> Logging interface needed
> ------------------------
>
>                 Key: MYNEWT-2
>                 URL: https://issues.apache.org/jira/browse/MYNEWT-2
>             Project: Mynewt
>          Issue Type: New Feature
>            Reporter: Sterling Hughes
>            Assignee: Sterling Hughes
>
> There should be a standard logging interface & package, that is usable by all 
> programs.
> This logger should have the following functionality: 
> - Multiple destinations to store the log data  
>   - FS
>   - Memory
>   - Console 
> - The ability to have log data come from a specific sub-system (i.e. "os" or 
> "ble"), and to direct those different subsystems to different storage 
> locations. (i.e. write OS to FS, write BLE to memory, etc.)
> - A log mask which allows you to turn on and off multiple log levels 
> simultaneously.  
> Every log entry should have minimally: 
> - Timestamp (64-bits of time) 
> - Log Level / Type
> - Entry length 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to