![]() |
PDK API Guide for J721E
|
Files | |
| file | ub_logging.h |
| Control logging by levels and categories. | |
Functions | |
| void | ub_console_debug_select_print (bool console, bool debug, const char *astr) |
| output to console out and debug out by selection More... | |
| const char * | ub_log_initstr_override (const char *ns, const char *os) |
| override 'istr' of ub_log_inig More... | |
| void | ub_log_init (const char *istr) |
| initialize logging by a string More... | |
| int | ub_log_add_category (const char *catstr) |
| add a category of logging at the bottom of the index More... | |
| int | ub_log_print (int cat_index, int flags, ub_dbgmsg_level_t level, const char *astr) |
| print log message More... | |
| bool | ub_clog_on (int cat_index, ub_dbgmsg_level_t level) |
| check if console log is enabled or not for the indicated cat_index and level More... | |
| bool | ub_dlog_on (int cat_index, ub_dbgmsg_level_t level) |
| check if debug log is enabled or not for the indicated cat_index and level More... | |
| int | ub_log_change (int cat_index, ub_dbgmsg_level_t clevel, ub_dbgmsg_level_t dlevel) |
| change console log level to clevel, and debug log level to delevl More... | |
| int | ub_log_return (int cat_index) |
| return console log level and console log level to the previous status More... | |
| void | ub_log_flush (void) |
| flush out messages on the both of cosole log and debug log More... | |
Enumerations | |
| enum | ub_dbgmsg_level_t { UBL_NONE =0, UBL_FATAL =1, UBL_ERROR =2, UBL_WARN =3, UBL_INFO =4, UBL_INFOV =5, UBL_DEBUG =6, UBL_DEBUGV =7 } |
| This defines different logging levels. More... | |
Macros | |
| #define | MAX_LOGMSG_CATEGORIES 16 |
| maximum number of categories More... | |
| #define | DBGMSG_LEVEL_MARK {"NON", "FTL", "ERR", "WRN", "INF", "IFV", "DBG", "DBV"} |
| 3-charcter string to represent each logging level More... | |
| #define | UBL_TS_BIT_FIELDS 3 |
| lowest 2 bits are used for TS Clock type, use ub_clocktype_t UB_CLOCK_DEFAULT means no-timestamp More... | |
| #define | UBL_OVERRIDE_ISTR(x, y) ub_log_initstr_override(x,UBB_GETENV(y)) |
| override valuse 'x' to the value of the environment variable 'y' More... | |
| #define | PRINT_FORMAT_ATTRIBUTE1 __attribute__((format (printf, 1, 2))) |
| let the compiler show warning when printf type format is wrong More... | |
| #define | PRINT_FORMAT_ATTRIBUTE4 __attribute__((format (printf, 4, 5))) |
| format starts at 4th argument More... | |
| #define MAX_LOGMSG_CATEGORIES 16 |
maximum number of categories
| #define DBGMSG_LEVEL_MARK {"NON", "FTL", "ERR", "WRN", "INF", "IFV", "DBG", "DBV"} |
3-charcter string to represent each logging level
| #define UBL_TS_BIT_FIELDS 3 |
lowest 2 bits are used for TS Clock type, use ub_clocktype_t UB_CLOCK_DEFAULT means no-timestamp
| #define UBL_OVERRIDE_ISTR | ( | x, | |
| y | |||
| ) | ub_log_initstr_override(x,UBB_GETENV(y)) |
override valuse 'x' to the value of the environment variable 'y'
| #define PRINT_FORMAT_ATTRIBUTE1 __attribute__((format (printf, 1, 2))) |
let the compiler show warning when printf type format is wrong
format starts at 1st argument
| #define PRINT_FORMAT_ATTRIBUTE4 __attribute__((format (printf, 4, 5))) |
format starts at 4th argument
| enum ub_dbgmsg_level_t |
This defines different logging levels.
| Enumerator | |
|---|---|
| UBL_NONE | |
| UBL_FATAL | |
| UBL_ERROR | |
| UBL_WARN | |
| UBL_INFO | |
| UBL_INFOV | |
| UBL_DEBUG | |
| UBL_DEBUGV | |
| void ub_console_debug_select_print | ( | bool | console, |
| bool | debug, | ||
| const char * | astr | ||
| ) |
output to console out and debug out by selection
| console | select output to console |
| debug | select output to debug memory |
| astr | a string to print |
| const char* ub_log_initstr_override | ( | const char * | ns, |
| const char * | os | ||
| ) |
override 'istr' of ub_log_inig
| ns | original 'istr' |
| os | overriding string |
| void ub_log_init | ( | const char * | istr | ) |
initialize logging by a string
| istr | initialization string |
| int ub_log_add_category | ( | const char * | catstr | ) |
add a category of logging at the bottom of the index
| catstr | category initialization string |
| int ub_log_print | ( | int | cat_index, |
| int | flags, | ||
| ub_dbgmsg_level_t | level, | ||
| const char * | astr | ||
| ) |
print log message
| cat_index | index of categories, the index is defined by the initialization string in unibase_init function |
| flags | timestamp option is defined in lower 2 bits. |
| level | log level, see ub_dbgmsg_level_t |
| astr | a string to print |
| bool ub_clog_on | ( | int | cat_index, |
| ub_dbgmsg_level_t | level | ||
| ) |
check if console log is enabled or not for the indicated cat_index and level
| bool ub_dlog_on | ( | int | cat_index, |
| ub_dbgmsg_level_t | level | ||
| ) |
check if debug log is enabled or not for the indicated cat_index and level
| int ub_log_change | ( | int | cat_index, |
| ub_dbgmsg_level_t | clevel, | ||
| ub_dbgmsg_level_t | dlevel | ||
| ) |
change console log level to clevel, and debug log level to delevl
| int ub_log_return | ( | int | cat_index | ) |
return console log level and console log level to the previous status
| void ub_log_flush | ( | void | ) |
flush out messages on the both of cosole log and debug log