changed the way debug level works

This commit is contained in:
Fufu Fang 2024-05-05 02:00:46 +01:00
parent be666d72e9
commit 01fd2e9559
No known key found for this signature in database
GPG Key ID: 8A4CB08B0A7E27CE
2 changed files with 6 additions and 3 deletions

View File

@ -15,7 +15,11 @@ int log_level_init()
if (env) {
return atoi(env);
}
#ifdef DEBUG
return DEFAULT_LOG_LEVEL | debug;
#else
return DEFAULT_LOG_LEVEL;
#endif
}
void

View File

@ -1,7 +1,6 @@
#ifndef LOG_H
#define LOG_H
#define DEBUG 0
/**
* \brief Log types
*/
@ -10,7 +9,7 @@ typedef enum {
error = 1 << 1,
warning = 1 << 2,
info = 1 << 3,
debug = DEBUG << 4,
debug = 1 << 4,
link_lock_debug = 1 << 5,
network_lock_debug = 1 << 6,
cache_lock_debug = 1 << 7,
@ -21,7 +20,7 @@ typedef enum {
/**
* \brief The default log level
*/
#define DEFAULT_LOG_LEVEL fatal | error | warning | info | debug
#define DEFAULT_LOG_LEVEL fatal | error | warning | info
/**
* \brief Get the log level from the environment.