![]() |
Maestro Audio Framework
v 1.0
NXP Semiconductors
|
Contains logging prototypes and definitions for the connected radio. More...
Macros | |
#define | LOGMDL_MAX_MODULES 6 |
Maximum number of modules supported. | |
#define | LOG_NAME_LENGTH 19 |
Maximum string length for module name. | |
#define | LOG_ENABLED |
The level of the error will be defined as: | |
#define | LOGLVL_CATASTROPHIC 0x01 |
Serious error. More... | |
#define | LOGLVL_ERROR 0x02 |
An error has occurred. More... | |
#define | LOGLVL_WARNING 0x04 |
A warning about a potential problem. | |
#define | LOGLVL_INFO 0x08 |
Information that could be useful to the user. | |
#define | LOGLVL_DEBUG 0x10 |
For developers for debugging. | |
#define | LOGLVL_FUNCTION_INFO 0x20 |
For developers debugging. More... | |
Additional level specifications used by set_debug_level() | |
These levels cannot be used by lprintf() | |
#define | LOGLVL_NONE 0x00 |
No error messages reported. | |
#define | LOGLVL_DEFAULT 0x03 |
#define | LOGLVL_ALL 0xFF |
All error messages reported. | |
Output location for the error logs | |
#define | LOGPUT_NONE 0x0 |
No output. | |
#define | LOGPUT_CONSOLE 0x1 |
Output goes to the terminal window. | |
#define | LOGPUT_FILE 0x2 |
Output goes to a file. | |
#define | LOGPUT_ALL 0x3 |
Output to all possibilities. | |
The module bit field definition. | |
#define | LOGMDL_COMMON 0x00000001 |
#define | LOGMDL_OSA 0x00000002 |
#define | LOGMDL_APP 0x00000004 |
#define | LOGMDL_GUI 0x00000008 |
Additional level specifications used by set_debug_module() | |
These levels cannot be used by lprintf(). The user can also OR several modules together for a custom selection. | |
#define | LOGMDL_NONE 0x00000000 |
#define | LOGMDL_ALL 0x3FFFFFFF |
LOGGING FUNCTION PROTOTYPES | |
#define | LOG_ENTER(module) |
Convenience function that prints a debug level message specifically for entering a function. More... | |
#define | LOG_EXIT(module) |
Convenience function that prints a debug level message specifically for exiting a function. More... | |
void | lprintf (const uint32_t module, const uint8_t level, const uint32_t error, const char *message,...) |
The function lprintf() is used in module code in place of printf(). More... | |
void | dlprintf (const uint32_t module, const char *message,...) |
This function is the information-specific shortcut variant of lprintf(). More... | |
void | ilprintf (const uint32_t module, const char *message,...) |
This function is the information-specific shortcut variant of lprintf(). More... | |
void | set_debug_module (const uint32_t module) |
Sets the module of interest based on bits set in module. More... | |
void | set_debug_level (const uint8_t level) |
Sets the levels to display based on bits set in level. More... | |
void | set_debug_out (const uint8_t output) |
Indicates where the output should go: to the console, a file, etc. More... | |
void | clear_debug_module (const uint32_t module) |
Clears the modules set in module. More... | |
void | clear_debug_level (const uint8_t level) |
Clears the levels set in level. More... | |
void | clear_debug_out (const uint8_t output) |
Clears the output bits set in output. More... | |
uint32_t | add_module_name (const uint32_t module, const char *name) |
Adds a name for a module to the system. More... | |
uint32_t | remove_module_name (const uint32_t module) |
Removes the name for a module. More... | |
uint32_t | add_error_name (const uint32_t error_id, const char *text) |
Adds a text string for an error of 25 char or less to the system. More... | |
char * | error_name (const uint32_t error_id) |
Returns a simple name for an error code, if it was pre-set with add_error_name(). More... | |
void | init_logging (void) |
Initializes the module and error tables. | |
void | deinit_logging (void) |
Deinitializes the module. | |
void | get_debug_state (void) |
Prints the settings for active modules, level and output. | |
#define LOGLVL_CATASTROPHIC 0x01 |
System cannot recover.
#define LOGLVL_ERROR 0x02 |
The system should be able to continue but an individual module may not be able to.
#define LOGLVL_FUNCTION_INFO 0x20 |
Function Enter/Exit info.
#define LOG_ENTER | ( | module | ) |
[in] | module | module id |
#define LOG_EXIT | ( | module | ) |
[in] | module | module id |
void lprintf | ( | const uint32_t | module, |
const uint8_t | level, | ||
const uint32_t | error, | ||
const char * | message, | ||
... | |||
) |
Different levels of information can be turned on or off at runtime for specific modules.
[in] | module | is an enumerated value defining the module this is used in |
[in] | level | is an enumerated value indicating the seriousness of the error |
[in] | error | is a defined error/warning code |
[in] | message | is a text message describing the error. The message can use args just as a standard printf. |
void dlprintf | ( | const uint32_t | module, |
const char * | message, | ||
... | |||
) |
It is the same as specifying lprintf(module, LOGLVL_DEBUG, ERRCODE_NO_ERROR, ...).
[in] | module | is an enumerated value defining the module this is used in |
[in] | message | is a text message describing the error. The message can use args just as a standard printf. |
void ilprintf | ( | const uint32_t | module, |
const char * | message, | ||
... | |||
) |
It is the same as specifying lprintf(module, LOGLVL_INFO, ERRCODE_NO_ERROR, ...).
[in] | module | is an enumerated value defining the module that this is used in |
[in] | message | is a text message describing the error. The message can use args just as a standard printf. |
void set_debug_module | ( | const uint32_t | module | ) |
Adds to any already set.
[in] | module | bit(s) to be added to active modules. This value is generated by or'ing the LOGMDL_* defines. |
void set_debug_level | ( | const uint8_t | level | ) |
Adds to those already set.
[in] | level | bit(s) to be added to active levels. This value is generated by or'ing the LOGLVL_* defines. |
void set_debug_out | ( | const uint8_t | output | ) |
[in] | output | bit(s) to be added to active output. This should be one of the LOGPUT_* defines. |
void clear_debug_module | ( | const uint32_t | module | ) |
[in] | module | bit(s) to be cleared in active modules. This value is generated by or'ing the LOGMDL_* defines. |
void clear_debug_level | ( | const uint8_t | level | ) |
[in] | level | bit(s) to be removed from active levels. This value is generated by or'ing the LOGLVL_* defines. |
void clear_debug_out | ( | const uint8_t | output | ) |
[in] | output | bit(s) to be removed from active output. This should be one of the LOGPUT_* defines. |
uint32_t add_module_name | ( | const uint32_t | module, |
const char * | name | ||
) |
The module name will be printed with the output of lprintf().
[in] | module | id of a module |
[in] | name | name for the module |
ERRCODE_NO_ERROR | worked as expected |
ERRCODE_PARAMETER_EXISTS | the module id already has a name |
ERRCODE_SYSTEM_LIMIT | the system has run out of places to store module information |
uint32_t remove_module_name | ( | const uint32_t | module | ) |
[in] | module | id of a module |
ERRCODE_NO_ERROR | worked as expected |
ERRCODE_NOT_FOUND | no text was found for this module |
uint32_t add_error_name | ( | const uint32_t | error_id, |
const char * | text | ||
) |
The error text will be printed with the output of lprintf().
[in] | error_id | error the text will be added to |
[in] | text | error text to be printed for error_id |
ERRCODE_NO_ERROR | worked as expected |
ERRCODE_PARAMETER_EXISTS | the error id already has identifying text |
ERRCODE_SYSTEM_LIMIT | the system has run out of places to store error information |
char* error_name | ( | const uint32_t | error_id | ) |
[in] | error_id | an error code indicating a particular error |