K-FSW ec10f94
Modular flight software on Zephyr, for small satellites
Loading...
Searching...
No Matches
log.h File Reference
#include <stdint.h>
#include <kfsw/services/parameter.h>

Macros

#define KFSW_LOG_PRINTF_LIKE(format_index, first_arg)
 
#define KFSW_LOG_MODULE   KFSW_LOG_MODULE_APP
 
#define KFSW_LOG_PARAM_TABLE_ID   25U
 
#define KFSW_LOG_PARAM_TABLE_NAME   "log"
 

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_COUNT
}
 

Functions

const char * kfsw_log_module_name (enum kfsw_log_module module)
 
uint8_t kfsw_log_get_module_level (enum kfsw_log_module module)
 
int kfsw_log_set_module_level (enum kfsw_log_module module, uint8_t level)
 
void kfsw_log_write (uint8_t module, uint8_t severity, const char *format,...) KFSW_LOG_PRINTF_LIKE(3
 
void 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
 

Variables

const struct kfsw_param_definition_set kfsw_log_param_definitions
 

Description

Runtime-filtered logging API.

Macro Documentation

◆ KFSW_LOG_PARAM_TABLE_ID

#define KFSW_LOG_PARAM_TABLE_ID   25U

Parameter table of the log service, in the service band.

◆ KFSW_LOG_PARAM_TABLE_NAME

#define KFSW_LOG_PARAM_TABLE_NAME   "log"

Parameter table name.

Enumeration Documentation

◆ kfsw_log_module

Modules a message can be attributed to.

The order matches the level array and the snapshot, so don't renumber them.

Function Documentation

◆ kfsw_log_debug()

void void void void kfsw_log_debug ( const char *  format,
  ... 
)

Log a debug message.

Parameters
formatprintf-style format string.
...Format arguments.

◆ kfsw_log_error()

void kfsw_log_error ( const char *  format,
  ... 
)

Log an error message.

Parameters
formatprintf-style format string.
...Format arguments.

◆ kfsw_log_get_level()

uint8_t kfsw_log_get_level ( void  )

Return the active runtime minimum log level.

◆ kfsw_log_get_module_level()

uint8_t kfsw_log_get_module_level ( enum kfsw_log_module  module)

Minimum level for one module.

◆ kfsw_log_info()

void void void kfsw_log_info ( const char *  format,
  ... 
)

Log an informational message.

Parameters
formatprintf-style format string.
...Format arguments.

◆ kfsw_log_module_name()

const char * kfsw_log_module_name ( enum kfsw_log_module  module)

Short stable name for a module, as the shell and the docs print it.

◆ kfsw_log_set_level()

void int kfsw_log_set_level ( uint8_t  level)

Set the runtime minimum log level (0 DEBUG through 4 disabled).

◆ kfsw_log_set_module_level()

int kfsw_log_set_module_level ( enum kfsw_log_module  module,
uint8_t  level 
)

Set the minimum level for one module.

Return values
0Applied.
-EINVALUnknown module.
-ERANGELevel above 4.

◆ kfsw_log_warning()

void void kfsw_log_warning ( const char *  format,
  ... 
)

Log a warning message.

Parameters
formatprintf-style format string.
...Format arguments.

◆ kfsw_log_write()

void kfsw_log_write ( uint8_t  module,
uint8_t  severity,
const char *  format,
  ... 
)

Write one message.

Called through the kfsw_log_* macros, not directly.

Variable Documentation

◆ kfsw_log_param_definitions

const struct kfsw_param_definition_set kfsw_log_param_definitions
extern

Parameter definitions of the log service.