1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
#pragma once
#include <stdio.h>
#define LOG(channel, tag, ...) \
{ \
fprintf(channel, "[%s] %s:%d: ", #tag, __FILE__, __LINE__); \
fprintf(channel, __VA_ARGS__); \
fprintf(channel, "\n"); \
}
#define LOGD(...) LOG(stdout, DEBUG, __VA_ARGS__)
#define LOGI(...) LOG(stdout, INFO, __VA_ARGS__)
#define LOGW(...) LOG(stdout, WARN, __VA_ARGS__)
#define LOGE(...) LOG(stderr, ERROR, __VA_ARGS__)
|