Firmware SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
bc_log

Logging facility (output on TXD2, format 115200 / 8N1) More...

Macros

#define BC_LOG_UART   BC_UART_UART2
 
#define BC_LOG_DUMP_WIDTH   8
 

Enumerations

enum  bc_log_level_t {
  BC_LOG_LEVEL_DUMP = 0,
  BC_LOG_LEVEL_DEBUG = 1,
  BC_LOG_LEVEL_INFO = 2,
  BC_LOG_LEVEL_WARNING = 3,
  BC_LOG_LEVEL_ERROR = 4,
  BC_LOG_LEVEL_OFF = 5
}
 Log level. More...
 
enum  bc_log_timestamp_t {
  BC_LOG_TIMESTAMP_OFF = -1,
  BC_LOG_TIMESTAMP_ABS = 0,
  BC_LOG_TIMESTAMP_REL = 1
}
 Log timestamp. More...
 

Functions

void bc_log_init (bc_log_level_t level, bc_log_timestamp_t timestamp)
 Initialize logging facility. More...
 
void bc_log_dump (const void *buffer, size_t length, const char *format,...)
 Log DUMP message (annotated in log as <X>) More...
 
void bc_log_debug (const char *format,...)
 Log DEBUG message (annotated in log as <D>) More...
 
void bc_log_info (const char *format,...)
 Log INFO message (annotated in log as ) More...
 
void bc_log_warning (const char *format,...)
 Log WARNING message (annotated in log as <W>) More...
 
void bc_log_error (const char *format,...)
 Log ERROR message (annotated in log as <E>) More...
 

Detailed Description

Logging facility (output on TXD2, format 115200 / 8N1)

Enumeration Type Documentation

Log level.

Enumerator
BC_LOG_LEVEL_DUMP 

Logging DUMP.

BC_LOG_LEVEL_DEBUG 

Log level DEBUG.

BC_LOG_LEVEL_INFO 

Log level INFO.

BC_LOG_LEVEL_WARNING 

Log level WARNING.

BC_LOG_LEVEL_ERROR 

Log level ERROR.

BC_LOG_LEVEL_OFF 

Logging disabled.

Definition at line 19 of file bc_log.h.

Log timestamp.

Enumerator
BC_LOG_TIMESTAMP_OFF 

Timestamp logging disabled.

BC_LOG_TIMESTAMP_ABS 

Timestamp logging enabled (absolute time format)

BC_LOG_TIMESTAMP_REL 

Timestamp logging enabled (relative time format)

Definition at line 43 of file bc_log.h.

Function Documentation

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

Log DEBUG message (annotated in log as <D>)

Parameters
[in]formatFormat string (printf style)
[in]...Optional format arguments

Definition at line 144 of file bc_log.c.

void bc_log_dump ( const void *  buffer,
size_t  length,
const char *  format,
  ... 
)

Log DUMP message (annotated in log as <X>)

Parameters
[in]bufferPointer to source buffer
[in]lengthNumber of bytes to be printed
[in]formatFormat string (printf style)
[in]...Optional format arguments

Definition at line 41 of file bc_log.c.

Here is the call graph for this function:

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

Log ERROR message (annotated in log as <E>)

Parameters
[in]formatFormat string (printf style)
[in]...Optional format arguments

Definition at line 171 of file bc_log.c.

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

Log INFO message (annotated in log as )

Parameters
[in]formatFormat string (printf style)
[in]...Optional format arguments

Definition at line 153 of file bc_log.c.

void bc_log_init ( bc_log_level_t  level,
bc_log_timestamp_t  timestamp 
)

Initialize logging facility.

Parameters
[in]levelMinimum required message level for propagation
[in]timestampTimestamp logging setting

Definition at line 23 of file bc_log.c.

Here is the call graph for this function:

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

Log WARNING message (annotated in log as <W>)

Parameters
[in]formatFormat string (printf style)
[in]...Optional format arguments

Definition at line 162 of file bc_log.c.