36 lines
726 B
C
36 lines
726 B
C
#ifndef _LOGGER_H_
|
|
#define _LOGGER_H_
|
|
|
|
|
|
|
|
|
|
typedef enum {
|
|
LOG_HIGH,
|
|
LOG_RED,
|
|
LOG_GREEN,
|
|
LOG_BLUE,
|
|
LOG_YELLOW
|
|
} t_logColor;
|
|
|
|
// initialize the logger, creates a ringbuffer
|
|
void logInit();
|
|
|
|
// de-initialize the logger, free the ringbuffer
|
|
void logFree();
|
|
|
|
// log a message, make sure it is a null-terminated string
|
|
// return value can be ignored, it is only used in test
|
|
int logMsg(const char *format, ...);
|
|
|
|
// in red
|
|
int errMsg(const char *format, ...);
|
|
|
|
int coloredMsg(const t_logColor color, const char *format, ...);
|
|
|
|
// reads the ringbuffer and transfers data to output channel
|
|
// call this from the idle-loop
|
|
// return value can be ignored, it is only used in test
|
|
int logExec();
|
|
|
|
#endif // _LOGGER_H_
|