ACU6 Device API
Typedefs | Enumerations | Functions
log

Actia library log control. More...

Typedefs

typedef void(* a_log_function) (a_log_level level, const char *format, va_list ap)
 Logger function prototype. More...
 

Enumerations

enum  a_log_level {
  A_LOG_DEBUG , A_LOG_INFO , A_LOG_WARNING , A_LOG_ERROR ,
  A_LOG_FATAL
}
 Actia library log levels. More...
 

Functions

void a_log_set_logger (a_log_function function)
 Set Actia library logging function. More...
 
void a_log_syslog_logger (a_log_level level, const char *format, va_list ap)
 Syslog logger. More...
 
void a_log_stdout_logger (a_log_level level, const char *format, va_list ap)
 Standard output logger. More...
 
void a_log_stderr_logger (a_log_level level, const char *format, va_list ap)
 Standard error logger. More...
 

Detailed Description

Actia library log control.

Typedef Documentation

◆ a_log_function

typedef void(* a_log_function) (a_log_level level, const char *format, va_list ap)

Logger function prototype.

For use with a_log_set_logger().

Parameters
levelThe log level of the message
formatprintf-style format string
arprintf arguments

Enumeration Type Documentation

◆ a_log_level

Actia library log levels.

Enumerator
A_LOG_DEBUG 

Debug info.

A_LOG_INFO 

Ordinary event.

A_LOG_WARNING 

Ordinary event, but not quite expected (e.g.

bad frame)

A_LOG_ERROR 

Extraordinary event.

A_LOG_FATAL 

Extreme event.

Application will abort immediately.

Function Documentation

◆ a_log_set_logger()

void a_log_set_logger ( a_log_function  function)

Set Actia library logging function.

All Actia library log messages will invoke this function to log messages.

Note: This setting only affects logs for the instance of the Actia library in the current application. Device system logs are not affected.

Logs are sent to syslog by default ( a_log_syslog_logger() ).

The built-in logger functions are named a_log_*_logger().

Parameters
functionFunction that will be called for each log message

◆ a_log_stderr_logger()

void a_log_stderr_logger ( a_log_level  level,
const char *  format,
va_list  ap 
)

Standard error logger.

Sends all messages to standard error (stderr), prefixed with the log level.

See also
a_log_set_logger()

◆ a_log_stdout_logger()

void a_log_stdout_logger ( a_log_level  level,
const char *  format,
va_list  ap 
)

Standard output logger.

Sends all messages to standard output (stdout), prefixed with the log level.

See also
a_log_set_logger()

◆ a_log_syslog_logger()

void a_log_syslog_logger ( a_log_level  level,
const char *  format,
va_list  ap 
)

Syslog logger.

Sends all messages to the syslog, mapping the log level.

See also
a_log_set_logger()