|
PebbleOS
|
Leveled logging to the serial console (or PULSE) and to flash. More...
Modules | |
| Binary logging | |
| Wire format of binary log messages. | |
| Log hashing | |
Compile-time replacement of log strings by tokens (CONFIG_LOG_HASHED). | |
Macros | |
| #define | SPLIT_64_BIT_ARG(x) (uint32_t)((x >> 32) & 0xFFFFFFFF), (uint32_t)(x & 0xFFFFFFFF) |
| Expand a 64-bit value into two 32-bit arguments, high word first. | |
| #define | LOG_BUFFER_LENGTH 128 |
| Size of the buffer a log message is formatted into, header included. | |
| #define | LOGGING_MIN_STACK_FOR_SPRINTF 240 |
| Minimum free stack, in bytes, to format a message; below it the message is replaced. | |
| #define | LOGGING_STACK_FULL_MSG ((const char *)" [STK FULL]") |
| Message logged instead when the stack is too full to format it. | |
| #define | LOG_LEVEL_ALWAYS 0 |
| Level of messages that are never filtered. | |
| #define | LOG_LEVEL_ERROR 1 |
| Error level. | |
| #define | LOG_LEVEL_WARNING 50 |
| Warning level. | |
| #define | LOG_LEVEL_INFO 100 |
| Info level. | |
| #define | LOG_LEVEL_DEBUG 200 |
| Debug level. | |
| #define | LOG_LEVEL_DEBUG_VERBOSE 255 |
| Verbose debug level. | |
| #define | LOG_LEVEL_OFF (-1) |
| Module level that disables every message of the module. | |
| #define | DEFAULT_LOG_LEVEL LOG_LEVEL_DEBUG |
Compile-time level of files without a log module, from CONFIG_DEFAULT_LOG_LEVEL. | |
| #define | FLASH_LOG_LEVEL LOG_LEVEL_INFO |
Highest level written to the flash log, from the CONFIG_FLASH_LOG_LEVEL_ choice. | |
| #define | STRINGIFY_NX(a) #a |
| Turn the argument into a string literal without expanding it. | |
| #define | STRINGIFY(a) STRINGIFY_NX(a) |
| Turn the expansion of the argument into a string literal. | |
| #define | STATUS_STRING(s) STRINGIFY(s) |
| Turn the expansion of a status code into a string literal. | |
| #define | PBL_LOG_MODULE_DEFINE(name, level) PBL_UNUSED static const int16_t _pbl_log_module_level = 0 |
| Put the current file in a log module, defining the module. | |
| #define | PBL_LOG_MODULE_DECLARE(name, level) PBL_LOG_MODULE_DEFINE(name, level) |
| Put the current file in a log module defined in another file. | |
| #define | PBL_LOG_MODULE_LEVEL_GET(name) |
Get the runtime level of a module built with CONFIG_<module>_LOG_LEVEL_RUNTIME. | |
| #define | PBL_LOG_MODULE_LEVEL_SET(name, level) |
Set the runtime level of a module built with CONFIG_<module>_LOG_LEVEL_RUNTIME. | |
| #define | PBL_SHOULD_LOG(level) |
| Check whether the current file logs messages of a level. | |
| #define | PBL_LOG_COLOR(level, color, fmt, ...) |
| Log a message with an explicit level and color, possibly queued. | |
| #define | PBL_LOG_COLOR_SYNC(level, color, fmt, ...) |
| Log a message with an explicit level and color, sent before returning. | |
| #define | PBL_LOG_ALWAYS(fmt, ...) PBL_LOG_COLOR(LOG_LEVEL_ALWAYS, LOG_COLOR_FOR_ALWAYS, fmt, ##__VA_ARGS__) |
| Log a message that is never filtered, possibly queued. | |
| #define | PBL_LOG_ERR(fmt, ...) PBL_LOG_COLOR(LOG_LEVEL_ERROR, LOG_COLOR_FOR_ERROR, fmt, ##__VA_ARGS__) |
| Log an error, possibly queued. | |
| #define | PBL_LOG_WRN(fmt, ...) PBL_LOG_COLOR(LOG_LEVEL_WARNING, LOG_COLOR_FOR_WARNING, fmt, ##__VA_ARGS__) |
| Log a warning, possibly queued. | |
| #define | PBL_LOG_INFO(fmt, ...) PBL_LOG_COLOR(LOG_LEVEL_INFO, LOG_COLOR_FOR_INFO, fmt, ##__VA_ARGS__) |
| Log an attention-worthy event, possibly queued. | |
| #define | PBL_LOG_DBG(fmt, ...) PBL_LOG_COLOR(LOG_LEVEL_DEBUG, LOG_COLOR_FOR_DEBUG, fmt, ##__VA_ARGS__) |
| Log a routine debug message, possibly queued. | |
| #define | PBL_LOG_VERBOSE(fmt, ...) PBL_LOG_COLOR(LOG_LEVEL_DEBUG_VERBOSE, LOG_COLOR_FOR_VERBOSE, fmt, ##__VA_ARGS__) |
| Log a verbose debug message, possibly queued. | |
| #define | PBL_LOG_SYNC_ALWAYS(fmt, ...) PBL_LOG_COLOR_SYNC(LOG_LEVEL_ALWAYS, LOG_COLOR_FOR_ALWAYS, fmt, ##__VA_ARGS__) |
| Log a message that is never filtered, sent before returning. | |
| #define | PBL_LOG_SYNC_ERR(fmt, ...) PBL_LOG_COLOR_SYNC(LOG_LEVEL_ERROR, LOG_COLOR_FOR_ERROR, fmt, ##__VA_ARGS__) |
| Log an error, sent before returning. | |
| #define | PBL_LOG_SYNC_WRN(fmt, ...) PBL_LOG_COLOR_SYNC(LOG_LEVEL_WARNING, LOG_COLOR_FOR_WARNING, fmt, ##__VA_ARGS__) |
| Log a warning, sent before returning. | |
| #define | PBL_LOG_SYNC_INFO(fmt, ...) PBL_LOG_COLOR_SYNC(LOG_LEVEL_INFO, LOG_COLOR_FOR_INFO, fmt, ##__VA_ARGS__) |
| Log an attention-worthy event, sent before returning. | |
| #define | PBL_LOG_SYNC_DBG(fmt, ...) PBL_LOG_COLOR_SYNC(LOG_LEVEL_DEBUG, LOG_COLOR_FOR_DEBUG, fmt, ##__VA_ARGS__) |
| Log a routine debug message, sent before returning. | |
| #define | PBL_LOG_SYNC_VERBOSE(fmt, ...) PBL_LOG_COLOR_SYNC(LOG_LEVEL_DEBUG_VERBOSE, LOG_COLOR_FOR_VERBOSE, fmt, ##__VA_ARGS__) |
| Log a verbose debug message, sent before returning. | |
| #define | RETURN_STATUS(st) return (st) |
| Return a status code, logging a warning if it is a failure. | |
| #define | RETURN_STATUS_UP(st) return ((st) == E_INVALID_ARGUMENT ? E_INTERNAL : (st)) |
Return a status code to the caller, turning E_INVALID_ARGUMENT into E_INTERNAL. | |
Functions | |
| void | pbl_log_hashed_async (const uint32_t packed_loghash,...) |
| Log a hashed message, possibly queued. | |
| void | pbl_log_hashed_sync (const uint32_t packed_loghash,...) |
| Log a hashed message, sent before returning. | |
| void | pbl_log_hashed_filtered_async (const uint32_t packed_loghash,...) |
| pbl_log_hashed_async() for modules with a runtime level, bypassing the sink filters. | |
| void | pbl_log_hashed_filtered_sync (const uint32_t packed_loghash,...) |
| pbl_log_hashed_sync() for modules with a runtime level, bypassing the sink filters. | |
| void | pbl_log_hashed_core (const uint32_t core_number, const uint32_t packed_loghash,...) |
| Log a hashed message from another core, possibly queued. | |
| void | pbl_log_hashed_vargs (const bool async, const uint32_t core_number, const uint32_t packed_loghash, va_list fmt_args) |
| Log a hashed message from another core, with a va_list. | |
| void | pbl_log_vargs (uint8_t log_level, const char *src_filename, int src_line_number, const char *fmt, va_list args) |
| Log a message with a va_list, possibly queued. | |
| void | pbl_log (uint8_t log_level, const char *src_filename, int src_line_number, const char *fmt,...) |
| Log a message, possibly queued. | |
| void | pbl_log_sync (uint8_t log_level, const char *src_filename, int src_line_number, const char *fmt,...) |
| Log a message, sent before returning. | |
| void | pbl_log_filtered (uint8_t log_level, const char *src_filename, int src_line_number, const char *fmt,...) |
| pbl_log() for modules with a runtime level, bypassing the sink filters. | |
| void | pbl_log_filtered_sync (uint8_t log_level, const char *src_filename, int src_line_number, const char *fmt,...) |
| pbl_log_sync() for modules with a runtime level, bypassing the sink filters. | |
| int | pbl_log_binary_format (char *buffer, int buffer_len, const uint8_t log_level, const char *src_filename_path, int src_line_number, const char *fmt, va_list args) |
| Format a message as a binary log record. | |
| int | pbl_log_get_bin_format (char *buffer, int buffer_len, const uint8_t log_level, const char *src_filename_path, int src_line_number, const char *fmt,...) |
| pbl_log_binary_format() with variadic arguments. | |
Log colors | |
Color names stored with hashed messages, used by the host console. | |
| #define | LOG_COLOR_BLACK "BLACK" |
| Black, hardly readable. | |
| #define | LOG_COLOR_RED "RED" |
| Red. | |
| #define | LOG_COLOR_GREEN "GREEN" |
| Green. | |
| #define | LOG_COLOR_YELLOW "YELLOW" |
| Yellow. | |
| #define | LOG_COLOR_BLUE "BLUE" |
| Blue. | |
| #define | LOG_COLOR_MAGENTA "MAGENTA" |
| Magenta. | |
| #define | LOG_COLOR_CYAN "CYAN" |
| Cyan. | |
| #define | LOG_COLOR_GREY "GREY" |
| Grey. | |
| #define | LOG_COLOR_LIGHT_GREY "LIGHT_GREY" |
| Light grey, reserved for bold like the other light colors. | |
| #define | LOG_COLOR_LIGHT_RED "LIGHT_RED" |
| Light red. | |
| #define | LOG_COLOR_LIGHT_GREEN "LIGHT_GREEN" |
| Light green. | |
| #define | LOG_COLOR_LIGHT_YELLOW "LIGHT_YELLOW" |
| Light yellow. | |
| #define | LOG_COLOR_LIGHT_BLUE "LIGHT_BLUE" |
| Light blue. | |
| #define | LOG_COLOR_LIGHT_MAGENTA "LIGHT_MAGENTA" |
| Light magenta. | |
| #define | LOG_COLOR_LIGHT_CYAN "LIGHT_CYAN" |
| Light cyan. | |
| #define | LOG_COLOR_WHITE "WHITE" |
| White. | |
| #define | LOG_COLOR_FOR_ALWAYS LOG_COLOR_BLUE |
| Color of LOG_LEVEL_ALWAYS messages. | |
| #define | LOG_COLOR_FOR_ERROR LOG_COLOR_RED |
| Color of LOG_LEVEL_ERROR messages. | |
| #define | LOG_COLOR_FOR_WARNING LOG_COLOR_YELLOW |
| Color of LOG_LEVEL_WARNING messages. | |
| #define | LOG_COLOR_FOR_INFO LOG_COLOR_GREEN |
| Color of LOG_LEVEL_INFO messages. | |
| #define | LOG_COLOR_FOR_DEBUG LOG_COLOR_GREY |
| Color of LOG_LEVEL_DEBUG messages. | |
| #define | LOG_COLOR_FOR_VERBOSE LOG_COLOR_GREY |
| Color of LOG_LEVEL_DEBUG_VERBOSE messages. | |
Leveled logging to the serial console (or PULSE) and to flash.
Use the level-named macros: PBL_LOG_ERR() and PBL_LOG_WRN() for errors and warnings, PBL_LOG_DBG() for routine lifecycle and state-transition messages, and PBL_LOG_INFO() only for events that deserve attention in a default-level capture; code paths that can fire repeatedly in normal use must not log at INFO. PBL_LOG_ALWAYS() is never filtered.
Each source file can belong to a log module with a Kconfig level, generated by subsys/logging/Kconfig.template.log_level; messages above the module level are compiled out. Files without a module use DEFAULT_LOG_LEVEL. A module built with CONFIG_<module>_LOG_LEVEL_RUNTIME keeps all its messages and filters them at runtime, see PBL_LOG_MODULE_LEVEL_SET().
The async macros may queue the message when called from an interrupt or with interrupts or the scheduler locked; the sync variants send it before returning in every context, for fault paths. With CONFIG_LOG_HASHED the format strings are replaced by tokens at build time (see Log hashing), which limits them to 7 conversions, 2 of them %s, 32-bit arguments and no %%.
%s with %x or %X in one message; the log dehasher cannot decode it. Split the message instead.Other files of the same module use PBL_LOG_MODULE_DECLARE() with the same arguments.
| #define DEFAULT_LOG_LEVEL LOG_LEVEL_DEBUG |
Compile-time level of files without a log module, from CONFIG_DEFAULT_LOG_LEVEL.
| #define FLASH_LOG_LEVEL LOG_LEVEL_INFO |
Highest level written to the flash log, from the CONFIG_FLASH_LOG_LEVEL_ choice.
| #define LOG_BUFFER_LENGTH 128 |
Size of the buffer a log message is formatted into, header included.
| #define LOG_COLOR_BLACK "BLACK" |
Black, hardly readable.
| #define LOG_COLOR_BLUE "BLUE" |
Blue.
| #define LOG_COLOR_CYAN "CYAN" |
Cyan.
| #define LOG_COLOR_FOR_ALWAYS LOG_COLOR_BLUE |
Color of LOG_LEVEL_ALWAYS messages.
| #define LOG_COLOR_FOR_DEBUG LOG_COLOR_GREY |
Color of LOG_LEVEL_DEBUG messages.
| #define LOG_COLOR_FOR_ERROR LOG_COLOR_RED |
Color of LOG_LEVEL_ERROR messages.
| #define LOG_COLOR_FOR_INFO LOG_COLOR_GREEN |
Color of LOG_LEVEL_INFO messages.
| #define LOG_COLOR_FOR_VERBOSE LOG_COLOR_GREY |
Color of LOG_LEVEL_DEBUG_VERBOSE messages.
| #define LOG_COLOR_FOR_WARNING LOG_COLOR_YELLOW |
Color of LOG_LEVEL_WARNING messages.
| #define LOG_COLOR_GREEN "GREEN" |
Green.
| #define LOG_COLOR_GREY "GREY" |
Grey.
| #define LOG_COLOR_LIGHT_BLUE "LIGHT_BLUE" |
Light blue.
| #define LOG_COLOR_LIGHT_CYAN "LIGHT_CYAN" |
Light cyan.
| #define LOG_COLOR_LIGHT_GREEN "LIGHT_GREEN" |
Light green.
| #define LOG_COLOR_LIGHT_GREY "LIGHT_GREY" |
Light grey, reserved for bold like the other light colors.
Use sparingly.
| #define LOG_COLOR_LIGHT_MAGENTA "LIGHT_MAGENTA" |
Light magenta.
| #define LOG_COLOR_LIGHT_RED "LIGHT_RED" |
Light red.
| #define LOG_COLOR_LIGHT_YELLOW "LIGHT_YELLOW" |
Light yellow.
| #define LOG_COLOR_MAGENTA "MAGENTA" |
Magenta.
| #define LOG_COLOR_RED "RED" |
Red.
| #define LOG_COLOR_WHITE "WHITE" |
White.
| #define LOG_COLOR_YELLOW "YELLOW" |
Yellow.
| #define LOG_LEVEL_ALWAYS 0 |
Level of messages that are never filtered.
| #define LOG_LEVEL_DEBUG 200 |
Debug level.
| #define LOG_LEVEL_DEBUG_VERBOSE 255 |
Verbose debug level.
| #define LOG_LEVEL_ERROR 1 |
Error level.
| #define LOG_LEVEL_INFO 100 |
Info level.
| #define LOG_LEVEL_OFF (-1) |
Module level that disables every message of the module.
| #define LOG_LEVEL_WARNING 50 |
Warning level.
| #define LOGGING_MIN_STACK_FOR_SPRINTF 240 |
Minimum free stack, in bytes, to format a message; below it the message is replaced.
| #define LOGGING_STACK_FULL_MSG ((const char *)" [STK FULL]") |
Message logged instead when the stack is too full to format it.
| #define PBL_LOG_ALWAYS | ( | fmt, | |
| ... | |||
| ) | PBL_LOG_COLOR(LOG_LEVEL_ALWAYS, LOG_COLOR_FOR_ALWAYS, fmt, ##__VA_ARGS__) |
Log a message that is never filtered, possibly queued.
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_LOG_COLOR | ( | level, | |
| color, | |||
| fmt, | |||
| ... | |||
| ) |
Log a message with an explicit level and color, possibly queued.
Prefer the level-named macros.
| level | Level, one of the LOG_LEVEL_ values. |
| color | Color, one of the LOG_COLOR_ values. |
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_LOG_COLOR_SYNC | ( | level, | |
| color, | |||
| fmt, | |||
| ... | |||
| ) |
Log a message with an explicit level and color, sent before returning.
Prefer the level-named macros.
| level | Level, one of the LOG_LEVEL_ values. |
| color | Color, one of the LOG_COLOR_ values. |
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_LOG_DBG | ( | fmt, | |
| ... | |||
| ) | PBL_LOG_COLOR(LOG_LEVEL_DEBUG, LOG_COLOR_FOR_DEBUG, fmt, ##__VA_ARGS__) |
Log a routine debug message, possibly queued.
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_LOG_ERR | ( | fmt, | |
| ... | |||
| ) | PBL_LOG_COLOR(LOG_LEVEL_ERROR, LOG_COLOR_FOR_ERROR, fmt, ##__VA_ARGS__) |
Log an error, possibly queued.
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_LOG_INFO | ( | fmt, | |
| ... | |||
| ) | PBL_LOG_COLOR(LOG_LEVEL_INFO, LOG_COLOR_FOR_INFO, fmt, ##__VA_ARGS__) |
Log an attention-worthy event, possibly queued.
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_LOG_MODULE_DECLARE | ( | name, | |
| level | |||
| ) | PBL_LOG_MODULE_DEFINE(name, level) |
Put the current file in a log module defined in another file.
| name | Module name, as given to PBL_LOG_MODULE_DEFINE(). |
| level | Kconfig level symbol, as given to PBL_LOG_MODULE_DEFINE(). |
| #define PBL_LOG_MODULE_DEFINE | ( | name, | |
| level | |||
| ) | PBL_UNUSED static const int16_t _pbl_log_module_level = 0 |
Put the current file in a log module, defining the module.
Use it once per module, in one source file, before any PBL_LOG macro.
| name | Module name, an identifier. |
| level | Kconfig level symbol, CONFIG_<module>_LOG_LEVEL. |
| #define PBL_LOG_MODULE_LEVEL_GET | ( | name | ) |
Get the runtime level of a module built with CONFIG_<module>_LOG_LEVEL_RUNTIME.
| name | Module name. |
| #define PBL_LOG_MODULE_LEVEL_SET | ( | name, | |
| level | |||
| ) |
Set the runtime level of a module built with CONFIG_<module>_LOG_LEVEL_RUNTIME.
Messages above the level are dropped; the global sink levels no longer apply to the module.
| name | Module name. |
| level | New level, one of the LOG_LEVEL_ values. |
| #define PBL_LOG_SYNC_ALWAYS | ( | fmt, | |
| ... | |||
| ) | PBL_LOG_COLOR_SYNC(LOG_LEVEL_ALWAYS, LOG_COLOR_FOR_ALWAYS, fmt, ##__VA_ARGS__) |
Log a message that is never filtered, sent before returning.
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_LOG_SYNC_DBG | ( | fmt, | |
| ... | |||
| ) | PBL_LOG_COLOR_SYNC(LOG_LEVEL_DEBUG, LOG_COLOR_FOR_DEBUG, fmt, ##__VA_ARGS__) |
Log a routine debug message, sent before returning.
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_LOG_SYNC_ERR | ( | fmt, | |
| ... | |||
| ) | PBL_LOG_COLOR_SYNC(LOG_LEVEL_ERROR, LOG_COLOR_FOR_ERROR, fmt, ##__VA_ARGS__) |
Log an error, sent before returning.
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_LOG_SYNC_INFO | ( | fmt, | |
| ... | |||
| ) | PBL_LOG_COLOR_SYNC(LOG_LEVEL_INFO, LOG_COLOR_FOR_INFO, fmt, ##__VA_ARGS__) |
Log an attention-worthy event, sent before returning.
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_LOG_SYNC_VERBOSE | ( | fmt, | |
| ... | |||
| ) | PBL_LOG_COLOR_SYNC(LOG_LEVEL_DEBUG_VERBOSE, LOG_COLOR_FOR_VERBOSE, fmt, ##__VA_ARGS__) |
Log a verbose debug message, sent before returning.
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_LOG_SYNC_WRN | ( | fmt, | |
| ... | |||
| ) | PBL_LOG_COLOR_SYNC(LOG_LEVEL_WARNING, LOG_COLOR_FOR_WARNING, fmt, ##__VA_ARGS__) |
Log a warning, sent before returning.
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_LOG_VERBOSE | ( | fmt, | |
| ... | |||
| ) | PBL_LOG_COLOR(LOG_LEVEL_DEBUG_VERBOSE, LOG_COLOR_FOR_VERBOSE, fmt, ##__VA_ARGS__) |
Log a verbose debug message, possibly queued.
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_LOG_WRN | ( | fmt, | |
| ... | |||
| ) | PBL_LOG_COLOR(LOG_LEVEL_WARNING, LOG_COLOR_FOR_WARNING, fmt, ##__VA_ARGS__) |
Log a warning, possibly queued.
| fmt | printf-style format, a string literal. |
| ... | Format arguments. |
| #define PBL_SHOULD_LOG | ( | level | ) |
Check whether the current file logs messages of a level.
Applies the module (or default) compile-time level and the module runtime level, if any.
| level | Level, one of the LOG_LEVEL_ values. |
| #define RETURN_STATUS | ( | st | ) | return (st) |
Return a status code, logging a warning if it is a failure.
| st | Status code. |
| #define RETURN_STATUS_UP | ( | st | ) | return ((st) == E_INVALID_ARGUMENT ? E_INTERNAL : (st)) |
Return a status code to the caller, turning E_INVALID_ARGUMENT into E_INTERNAL.
An invalid argument passed down by this layer is an internal error for its caller.
| st | Status code. |
| #define SPLIT_64_BIT_ARG | ( | x | ) | (uint32_t)((x >> 32) & 0xFFFFFFFF), (uint32_t)(x & 0xFFFFFFFF) |
Expand a 64-bit value into two 32-bit arguments, high word first.
Hashed logs only take 32-bit arguments; print the result with two conversions.
| x | 64-bit value. |
| #define STATUS_STRING | ( | s | ) | STRINGIFY(s) |
Turn the expansion of a status code into a string literal.
| s | Status code. |
| #define STRINGIFY | ( | a | ) | STRINGIFY_NX(a) |
Turn the expansion of the argument into a string literal.
| a | Argument. |
| #define STRINGIFY_NX | ( | a | ) | #a |
Turn the argument into a string literal without expanding it.
| a | Argument. |
| void pbl_log | ( | uint8_t | log_level, |
| const char * | src_filename, | ||
| int | src_line_number, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Log a message, possibly queued.
Prefer the PBL_LOG macros, which filter by level and hash the format.
| log_level | Level, one of the LOG_LEVEL_ values. |
| src_filename | Source file path. |
| src_line_number | Source line number. |
| fmt | printf-style format. |
| ... | Format arguments. |
| int pbl_log_binary_format | ( | char * | buffer, |
| int | buffer_len, | ||
| const uint8_t | log_level, | ||
| const char * | src_filename_path, | ||
| int | src_line_number, | ||
| const char * | fmt, | ||
| va_list | args | ||
| ) |
Format a message as a binary log record.
The record holds a timestamp, the level, the line number, the last 15 characters of the file name and the formatted message, truncated to fit.
| [out] | buffer | Destination, larger than the record header. |
| buffer_len | Size of buffer in bytes. | |
| log_level | Level, one of the LOG_LEVEL_ values. | |
| src_filename_path | Source file path. | |
| src_line_number | Source line number. | |
| fmt | printf-style format. | |
| args | Format arguments. |
| void pbl_log_filtered | ( | uint8_t | log_level, |
| const char * | src_filename, | ||
| int | src_line_number, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
pbl_log() for modules with a runtime level, bypassing the sink filters.
| log_level | Level, one of the LOG_LEVEL_ values. |
| src_filename | Source file path. |
| src_line_number | Source line number. |
| fmt | printf-style format. |
| ... | Format arguments. |
| void pbl_log_filtered_sync | ( | uint8_t | log_level, |
| const char * | src_filename, | ||
| int | src_line_number, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
pbl_log_sync() for modules with a runtime level, bypassing the sink filters.
| log_level | Level, one of the LOG_LEVEL_ values. |
| src_filename | Source file path. |
| src_line_number | Source line number. |
| fmt | printf-style format. |
| ... | Format arguments. |
| int pbl_log_get_bin_format | ( | char * | buffer, |
| int | buffer_len, | ||
| const uint8_t | log_level, | ||
| const char * | src_filename_path, | ||
| int | src_line_number, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
pbl_log_binary_format() with variadic arguments.
| [out] | buffer | Destination, larger than the record header. |
| buffer_len | Size of buffer in bytes. | |
| log_level | Level, one of the LOG_LEVEL_ values. | |
| src_filename_path | Source file path. | |
| src_line_number | Source line number. | |
| fmt | printf-style format. | |
| ... | Format arguments. |
| void pbl_log_hashed_async | ( | const uint32_t | packed_loghash, |
| ... | |||
| ) |
Log a hashed message, possibly queued.
Called by the PBL_LOG macros.
| packed_loghash | Message token, see Log hashing. |
| ... | Message arguments, 32 bits each. |
| void pbl_log_hashed_core | ( | const uint32_t | core_number, |
| const uint32_t | packed_loghash, | ||
| ... | |||
| ) |
Log a hashed message from another core, possibly queued.
| core_number | Core number, already shifted to PACKED_CORE_OFFSET. |
| packed_loghash | Message token, see Log hashing. |
| ... | Message arguments, 32 bits each. |
| void pbl_log_hashed_filtered_async | ( | const uint32_t | packed_loghash, |
| ... | |||
| ) |
pbl_log_hashed_async() for modules with a runtime level, bypassing the sink filters.
| packed_loghash | Message token, see Log hashing. |
| ... | Message arguments, 32 bits each. |
| void pbl_log_hashed_filtered_sync | ( | const uint32_t | packed_loghash, |
| ... | |||
| ) |
pbl_log_hashed_sync() for modules with a runtime level, bypassing the sink filters.
| packed_loghash | Message token, see Log hashing. |
| ... | Message arguments, 32 bits each. |
| void pbl_log_hashed_sync | ( | const uint32_t | packed_loghash, |
| ... | |||
| ) |
Log a hashed message, sent before returning.
Called by the PBL_LOG_SYNC macros.
| packed_loghash | Message token, see Log hashing. |
| ... | Message arguments, 32 bits each. |
| void pbl_log_hashed_vargs | ( | const bool | async, |
| const uint32_t | core_number, | ||
| const uint32_t | packed_loghash, | ||
| va_list | fmt_args | ||
| ) |
Log a hashed message from another core, with a va_list.
| async | Whether the message may be queued. |
| core_number | Core number, already shifted to PACKED_CORE_OFFSET. |
| packed_loghash | Message token, see Log hashing. |
| fmt_args | Message arguments, 32 bits each. |
| void pbl_log_sync | ( | uint8_t | log_level, |
| const char * | src_filename, | ||
| int | src_line_number, | ||
| const char * | fmt, | ||
| ... | |||
| ) |
Log a message, sent before returning.
| log_level | Level, one of the LOG_LEVEL_ values. |
| src_filename | Source file path. |
| src_line_number | Source line number. |
| fmt | printf-style format. |
| ... | Format arguments. |
| void pbl_log_vargs | ( | uint8_t | log_level, |
| const char * | src_filename, | ||
| int | src_line_number, | ||
| const char * | fmt, | ||
| va_list | args | ||
| ) |
Log a message with a va_list, possibly queued.
| log_level | Level, one of the LOG_LEVEL_ values. |
| src_filename | Source file path. |
| src_line_number | Source line number. |
| fmt | printf-style format. |
| args | Format arguments. |