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) { if (env) {
return atoi(env); return atoi(env);
} }
#ifdef DEBUG
return DEFAULT_LOG_LEVEL | debug;
#else
return DEFAULT_LOG_LEVEL; return DEFAULT_LOG_LEVEL;
#endif
} }
void void

View File

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