diff --git a/lib/log/log.c b/lib/log/log.c index 69dfdb464e..e8fa93d0b8 100644 --- a/lib/log/log.c +++ b/lib/log/log.c @@ -48,8 +48,36 @@ static const char *const spdk_level_names[] = { static logfunc *g_log = NULL; static bool g_log_timestamps = true; -extern enum spdk_log_level g_spdk_log_level; -extern enum spdk_log_level g_spdk_log_print_level; +enum spdk_log_level g_spdk_log_level; +enum spdk_log_level g_spdk_log_print_level; + +SPDK_LOG_REGISTER_COMPONENT(log) + +void +spdk_log_set_level(enum spdk_log_level level) +{ + assert(level >= SPDK_LOG_DISABLED); + assert(level <= SPDK_LOG_DEBUG); + g_spdk_log_level = level; +} + +enum spdk_log_level +spdk_log_get_level(void) { + return g_spdk_log_level; +} + +void +spdk_log_set_print_level(enum spdk_log_level level) +{ + assert(level >= SPDK_LOG_DISABLED); + assert(level <= SPDK_LOG_DEBUG); + g_spdk_log_print_level = level; +} + +enum spdk_log_level +spdk_log_get_print_level(void) { + return g_spdk_log_print_level; +} void spdk_log_open(logfunc *logf) diff --git a/lib/log/log_flags.c b/lib/log/log_flags.c index 9daffafc60..bcf9a19aec 100644 --- a/lib/log/log_flags.c +++ b/lib/log/log_flags.c @@ -37,39 +37,6 @@ static TAILQ_HEAD(, spdk_log_flag) g_log_flags = TAILQ_HEAD_INITIALIZER(g_log_flags); -enum spdk_log_level g_spdk_log_level = SPDK_LOG_NOTICE; -enum spdk_log_level g_spdk_log_print_level = SPDK_LOG_NOTICE; - -SPDK_LOG_REGISTER_COMPONENT(log) - -#define MAX_TMPBUF 1024 - -void -spdk_log_set_level(enum spdk_log_level level) -{ - assert(level >= SPDK_LOG_DISABLED); - assert(level <= SPDK_LOG_DEBUG); - g_spdk_log_level = level; -} - -enum spdk_log_level -spdk_log_get_level(void) { - return g_spdk_log_level; -} - -void -spdk_log_set_print_level(enum spdk_log_level level) -{ - assert(level >= SPDK_LOG_DISABLED); - assert(level <= SPDK_LOG_DEBUG); - g_spdk_log_print_level = level; -} - -enum spdk_log_level -spdk_log_get_print_level(void) { - return g_spdk_log_print_level; -} - static struct spdk_log_flag * get_log_flag(const char *name) {