|
K-FSW v1.2.1-59-gcaca356
KFSW: modular flight software on Zephyr, for small satellites
|
Public Headers | |
| file | log.h |
| file | log_history.h |
Data Structures | |
| struct | kfsw_log_record |
| struct | kfsw_log_encoded |
| struct | kfsw_log_history_window |
Macros | |
| #define | KFSW_LOG_PRINTF_LIKE(format_index, first_arg) |
| #define | KFSW_LOG_MODULE KFSW_LOG_MODULE_APP |
| #define | kfsw_log_marker(...) kfsw_log_write_marker(KFSW_LOG_MODULE, __VA_ARGS__) |
| #define | KFSW_LOG_PARAM_TABLE_ID 25U |
| #define | KFSW_LOG_PARAM_TABLE_NAME "log" |
| #define | KFSW_LOG_TEXT_SIZE 192U |
| #define | KFSW_LOG_HISTORY_MAX_READ 32U |
| #define | KFSW_LOG_ENCODED_SIZE 128U |
Enumerations | |
| enum | kfsw_log_module { KFSW_LOG_MODULE_APP = 0 , KFSW_LOG_MODULE_BOOT , KFSW_LOG_MODULE_LOG , KFSW_LOG_MODULE_PARAM , KFSW_LOG_MODULE_STORAGE , KFSW_LOG_MODULE_CSP , KFSW_LOG_MODULE_UART , KFSW_LOG_MODULE_FTP , KFSW_LOG_MODULE_FWU , KFSW_LOG_MODULE_HEALTH , KFSW_LOG_MODULE_COMMAND , KFSW_LOG_MODULE_EVENT , KFSW_LOG_MODULE_RADIO , KFSW_LOG_MODULE_HK , KFSW_LOG_MODULE_FBO , KFSW_LOG_MODULE_CAN , KFSW_LOG_MODULE_TABLE , KFSW_LOG_MODULE_REMEXEC , KFSW_LOG_MODULE_RESMON , KFSW_LOG_MODULE_GNDWDT , KFSW_LOG_MODULE_SCRUB , KFSW_LOG_MODULE_LIMITS , KFSW_LOG_MODULE_COUNT } |
Functions | |
| const char * | kfsw_log_module_name (enum kfsw_log_module module) |
| int | kfsw_log_set_module_level (enum kfsw_log_module module, uint8_t level) |
| uint8_t | kfsw_log_get_module_level (enum kfsw_log_module module) |
| void | kfsw_log_write (uint8_t module, uint8_t severity, const char *format,...) KFSW_LOG_PRINTF_LIKE(3 |
| void void | kfsw_log_write_marker (uint8_t module, const char *format,...) KFSW_LOG_PRINTF_LIKE(2 |
| int | kfsw_log_set_level (uint8_t level) |
| uint8_t | kfsw_log_get_level (void) |
| void | kfsw_log_error (const char *format,...) KFSW_LOG_PRINTF_LIKE(1 |
| void void | kfsw_log_warning (const char *format,...) KFSW_LOG_PRINTF_LIKE(1 |
| void void void | kfsw_log_info (const char *format,...) KFSW_LOG_PRINTF_LIKE(1 |
| void void void void | kfsw_log_debug (const char *format,...) KFSW_LOG_PRINTF_LIKE(1 |
| int | kfsw_log_history_window (uint16_t count, struct kfsw_log_history_window *window) |
| int | kfsw_log_history_get (uint64_t sequence, struct kfsw_log_record *record) |
| int | kfsw_log_history_get_encoded (uint64_t sequence, struct kfsw_log_encoded *record) |
| void | kfsw_log_history_format (const struct kfsw_log_encoded *encoded, struct kfsw_log_record *record) |
Variables | |
| const struct kfsw_param_definition_set | kfsw_log_param_definitions |
Console logging with build-time and runtime filters.
| #define KFSW_LOG_ENCODED_SIZE 128U |
#include <log_history.h>
Bytes a held record keeps: the message as a cbprintf package (format string address, arguments and any strings from RAM), or its text when the package does not fit.
| #define kfsw_log_marker | ( | ... | ) | kfsw_log_write_marker(KFSW_LOG_MODULE, __VA_ARGS__) |
#include <log.h>
Write a marker under the calling file's KFSW_LOG_MODULE.
| #define KFSW_LOG_PARAM_TABLE_ID 25U |
#include <log.h>
Parameter table of the log service, in the service band.
| #define KFSW_LOG_PARAM_TABLE_NAME "log" |
#include <log.h>
Parameter table name.
| enum kfsw_log_module |
#include <log.h>
Modules a message can be attributed to.
The order matches the level array and the snapshot, so don't renumber them.
| void void void void kfsw_log_debug | ( | const char * | format, |
| ... | |||
| ) |
#include <log.h>
Log a debug message.
| format | printf-style format string. |
| ... | Format arguments. |
| void kfsw_log_error | ( | const char * | format, |
| ... | |||
| ) |
#include <log.h>
Log an error message.
| format | printf-style format string. |
| ... | Format arguments. |
| uint8_t kfsw_log_get_level | ( | void | ) |
#include <log.h>
Return the active runtime minimum log level.
| uint8_t kfsw_log_get_module_level | ( | enum kfsw_log_module | module | ) |
#include <log.h>
The minimum level one module is held to.
Returns the disabled level for a module this build does not know, so a caller that walks the list cannot read past it.
| void kfsw_log_history_format | ( | const struct kfsw_log_encoded * | encoded, |
| struct kfsw_log_record * | record | ||
| ) |
#include <log_history.h>
Format a held record into text; newlines become spaces.
| int kfsw_log_history_get | ( | uint64_t | sequence, |
| struct kfsw_log_record * | record | ||
| ) |
#include <log_history.h>
Read one sequence as text.
-ENOENT means it was overwritten or never recorded.
| int kfsw_log_history_get_encoded | ( | uint64_t | sequence, |
| struct kfsw_log_encoded * | record | ||
| ) |
#include <log_history.h>
Read one sequence as it is held, package or text.
| int kfsw_log_history_window | ( | uint16_t | count, |
| struct kfsw_log_history_window * | window | ||
| ) |
#include <log_history.h>
Snapshot the bounds of the newest count records, without consuming them.
| void void void kfsw_log_info | ( | const char * | format, |
| ... | |||
| ) |
#include <log.h>
Log an informational message.
| format | printf-style format string. |
| ... | Format arguments. |
| const char * kfsw_log_module_name | ( | enum kfsw_log_module | module | ) |
#include <log.h>
Short stable name for a module, as the shell and the docs print it.
| int kfsw_log_set_level | ( | uint8_t | level | ) |
#include <log.h>
Set the runtime minimum log level (0 DEBUG through 4 disabled).
| int kfsw_log_set_module_level | ( | enum kfsw_log_module | module, |
| uint8_t | level | ||
| ) |
#include <log.h>
Set the minimum level for one module.
| 0 | Applied. |
| -EINVAL | Unknown module. |
| -ERANGE | Level above 4. |
| void void kfsw_log_warning | ( | const char * | format, |
| ... | |||
| ) |
#include <log.h>
Log a warning message.
| format | printf-style format string. |
| ... | Format arguments. |
| void kfsw_log_write | ( | uint8_t | module, |
| uint8_t | severity, | ||
| const char * | format, | ||
| ... | |||
| ) |
#include <log.h>
Write one message.
Called through the kfsw_log_* macros, not directly.
A s argument must be NUL-terminated even with a precision, as in %.*s: the history keeps a copy of each string from RAM, and that copy reads to the terminator.
| void void kfsw_log_write_marker | ( | uint8_t | module, |
| const char * | format, | ||
| ... | |||
| ) |
#include <log.h>
Write a marker that scripts look for, such as @READY.
No level hides a marker. It is kept in the history like any message and printed without a level tag or colour, so the line starts with the marker. Called through kfsw_log_marker(), not directly.
|
extern |
#include <log.h>
Parameter definitions of the log service.