|
#define | LOGMDL_MAX_MODULES 6 |
| Maximum number of modules supported.
|
|
#define | LOGMDL_MAX_ERRORS 17 |
| Maximum number of modules supported.
|
|
#define | LOG_NAME_LENGTH 19 |
| Maximum string length for module name.
|
|
#define | LOG_ENABLED |
| Logging enabled.
|
|
|
#define | LOGLVL_CATASTROPHIC 0x01 |
| Serious error. System cannot recover.
|
|
#define | LOGLVL_ERROR 0x02 |
| An error has occurred. The system should \ be able to continue but an individual \ module may not be able to.
|
|
#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. Function \ Enter/Exit info.
|
|
|
These levels cannot be used by lprintf()
|
#define | LOGLVL_NONE 0x00 |
| No error messages reported.
|
|
#define | LOGLVL_DEFAULT 0x03 |
| Default log level.
|
|
#define | LOGLVL_ALL 0xFF |
| All error messages reported.
|
|
|
#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 modules will be defined as bit settings in a 32 bit value so this is limited to 32 modules.
|
#define | LOGMDL_COMMON 0x00000001 |
| Common module.
|
|
#define | LOGMDL_OSA 0x00000002 |
| OSA module.
|
|
#define | LOGMDL_APP 0x00000004 |
| Application module.
|
|
#define | LOGMDL_GUI 0x00000008 |
| GUI module.
|
|
#define | LOGMDL_STREAMER 0x00000010 |
| Streamer module.
|
|
|
These levels cannot be used by lprintf(). The user can also OR several modules together for a custom selection.
|
#define | LOGMDL_NONE 0x00000000 |
| None module allowed.
|
|
#define | LOGMDL_ALL 0x3FFFFFFF |
| All modulew allowed.
|
|
|
#define | LOG_ENTER(module) lprintf(module, LOGLVL_FUNCTION_INFO, 0, "Entering: %s\n", __FUNCTION__) |
| Convenience function that prints a debug level message specifically for entering a function.
|
|
#define | LOG_EXIT(module) lprintf(module, LOGLVL_FUNCTION_INFO, 0, "Exiting: %s\n\n", __FUNCTION__) |
| Convenience function that prints a debug level message specifically for exiting a function.
|
|
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(). Different levels of information can be turned on or off at runtime for specific modules.
|
|
void | dlprintf (const uint32_t module, const char *message,...) |
| This function is the information-specific shortcut variant of lprintf(). It is the same as specifying lprintf(module,
LOGLVL_DEBUG, ERRCODE_NO_ERROR, ...).
|
|
void | ilprintf (const uint32_t module, const char *message,...) |
| This function is the information-specific shortcut variant of lprintf(). It is the same as specifying lprintf(module, LOGLVL_INFO,
ERRCODE_NO_ERROR, ...).
|
|
void | set_debug_module (const uint32_t module) |
| Sets the module of interest based on bits set in module. Adds to any already set.
|
|
void | set_debug_level (const uint8_t level) |
| Sets the levels to display based on bits set in level. Adds to those already set.
|
|
void | set_debug_out (const uint8_t output) |
| Indicates where the output should go: to the console, a file, etc.
|
|
void | clear_debug_module (const uint32_t module) |
| Clears the modules set in module.
|
|
void | clear_debug_level (const uint8_t level) |
| Clears the levels set in level.
|
|
void | clear_debug_out (const uint8_t output) |
| Clears the output bits set in output.
|
|
uint32_t | add_module_name (const uint32_t module, const char *name) |
| Adds a name for a module to the system. The module name will be printed with the output of lprintf().
|
|
uint32_t | remove_module_name (const uint32_t module) |
| Removes the name for a module.
|
|
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. The error text will be printed with the output of lprintf().
|
|
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().
|
|
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.
|
|