Skip to content

Commit faa5fc6

Browse files
authored
fix(logging): LOG_LEVEL doesn't work (#505)
fixs error : LOG_LEVEL doesn't work
1 parent 0870bfe commit faa5fc6

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/include/common/logger.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,13 @@ static constexpr auto PastLastSlash(cstr a) -> cstr { return PastLastSlash(a, a)
5454
})
5555

5656
// Log levels.
57-
static constexpr int LOG_LEVEL_OFF = 1000;
58-
static constexpr int LOG_LEVEL_ERROR = 500;
59-
static constexpr int LOG_LEVEL_WARN = 400;
60-
static constexpr int LOG_LEVEL_INFO = 300;
61-
static constexpr int LOG_LEVEL_DEBUG = 200;
62-
static constexpr int LOG_LEVEL_TRACE = 100;
63-
static constexpr int LOG_LEVEL_ALL = 0;
57+
#define LOG_LEVEL_OFF 1000
58+
#define LOG_LEVEL_ERROR 500
59+
#define LOG_LEVEL_WARN 400
60+
#define LOG_LEVEL_INFO 300
61+
#define LOG_LEVEL_DEBUG 200
62+
#define LOG_LEVEL_TRACE 100
63+
#define LOG_LEVEL_ALL 0
6464

6565
#define LOG_LOG_TIME_FORMAT "%Y-%m-%d %H:%M:%S"
6666
#define LOG_OUTPUT_STREAM stdout
@@ -71,11 +71,11 @@ static constexpr int LOG_LEVEL_ALL = 0;
7171
// #pragma message("Warning: LOG_LEVEL compile option was not explicitly
7272
// given.")
7373
#ifndef NDEBUG
74+
#define LOG_LEVEL LOG_LEVEL_DEBUG
7475
// #pragma message("LOG_LEVEL_DEBUG is used instead as DEBUG option is on.")
75-
static constexpr int LOG_LEVEL = LOG_LEVEL_DEBUG;
7676
#else
7777
// #pragma message("LOG_LEVEL_WARN is used instead as DEBUG option is off.")
78-
static constexpr int LOG_LEVEL = LOG_LEVEL_INFO;
78+
#define LOG_LEVEL LOG_LEVEL_INFO
7979
#endif
8080
// #pragma message("Give LOG_LEVEL compile option to overwrite the default
8181
// level.")

0 commit comments

Comments
 (0)