Write some basic logging macros
This commit is contained in:
parent
2a8be1c462
commit
bcfd4a839d
18
lib/include/logging.h
Normal file
18
lib/include/logging.h
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
#ifndef LOGGING_H
|
||||||
|
#define LOGGING_H
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#define LOG_ERROR(format, ...) \
|
||||||
|
do { \
|
||||||
|
fprintf(stderr, "ERROR %s: ", __func__); \
|
||||||
|
vfprintf(stderr, format, __VA_ARGS__); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#define LOG_INFO(format, ...) \
|
||||||
|
do { \
|
||||||
|
fprintf(stderr, "INFO %s: ", __func__); \
|
||||||
|
vfprintf(stderr, format, __VA_ARGS__); \
|
||||||
|
} while (0)
|
||||||
|
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user