lib/log: move some log level function to log.c
These set_level/get_level functions and REGISTER(log), have nothing to do with log_flag.c, why we put them there. I think we might as well put them to log.c. And "define MAX_TMPBUF 1024", repeated. Change-Id: I5ade71b923d61446a5f81f0d2f26fdc4a3057f02 Signed-off-by: wanghailiangx <hailiangx.e.wang@intel.com> Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10923 Reviewed-by: Paul Luse <paul.e.luse@intel.com> Reviewed-by: Changpeng Liu <changpeng.liu@intel.com> Reviewed-by: Jim Harris <james.r.harris@intel.com> Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
This commit is contained in:
parent
63ff27f910
commit
8e9bf1815d
@ -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)
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user