compile mode where no logging is produced
This commit is contained in:
parent
2563bbac57
commit
00b4214ea0
2 changed files with 10 additions and 0 deletions
4
config.h
Normal file
4
config.h
Normal file
|
@ -0,0 +1,4 @@
|
|||
// (C) 2018-2023 by Folkert van Heusden
|
||||
// Released under MIT license
|
||||
|
||||
#define TURBO
|
6
log.h
6
log.h
|
@ -5,6 +5,8 @@
|
|||
|
||||
#include <string>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
|
||||
typedef enum { debug, info, warning, ll_error, none } log_level_t; // TODO ll_ prefix
|
||||
|
||||
|
@ -14,9 +16,13 @@ void setloguid(const int uid, const int gid);
|
|||
void closelog();
|
||||
void dolog(const log_level_t ll, const char *fmt, ...);
|
||||
|
||||
#ifdef TURBO
|
||||
#define DOLOG(ll, always, fmt, ...) do { } while(0)
|
||||
#else
|
||||
#define DOLOG(ll, always, fmt, ...) do { \
|
||||
extern log_level_t log_level_file, log_level_screen; \
|
||||
\
|
||||
if (always || ll >= log_level_file || ll >= log_level_screen) \
|
||||
dolog(ll, fmt, ##__VA_ARGS__); \
|
||||
} while(0)
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue