The friendly Operating System for the Internet of Things
log.h File Reference

System logging header. More...

Detailed Description

This header offers a bunch of "LOG_*" functions that, with the default implementation, just use printf, but honour a verbosity level.

If desired, it is possible to implement a log module which then will be used instead the default printf-based implementation. In order to do so, the log module has to

  1. provide "log_module.h"
  2. have a name starting with "log_" or depend on the pseudo-module LOG,
  3. implement log_write()

See "sys/log/log_printfnoformat" for an example.

Kaspar Schleiser

Definition in file log.h.

#include <stdio.h>
+ Include dependency graph for log.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


 Default log level define.
#define LOG(level, ...)
 Log message if level <= LOG_LEVEL. More...
#define log_write(level, ...)   printf(__VA_ARGS__)
 Default log_write function, just maps to printf.
#define LOG_ERROR(...)   LOG(LOG_ERROR, __VA_ARGS__)
 logging convenience defines
#define LOG_INFO(...)   LOG(LOG_INFO, __VA_ARGS__)
#define LOG_DEBUG(...)   LOG(LOG_DEBUG, __VA_ARGS__)


enum  {
 defined log levels More...