From 85c5f64f4681a7f9b55f6a4423bd8ea46216fbb8 Mon Sep 17 00:00:00 2001 From: dev ferrumgate Date: Mon, 21 Nov 2022 11:48:42 +0300 Subject: [PATCH] changed log level to lowercase --- .vscode/launch.json | 2 +- docker.run.sh | 2 +- ferrum.io.sh | 2 +- src/main.c | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 1b93105..3d4018f 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -30,7 +30,7 @@ "environment": [ { "name": "LOG_LEVEL", - "value": "ALL" + "value": "all" }, { "name": "REDIS_HOST", diff --git a/docker.run.sh b/docker.run.sh index c2a7634..5d05510 100644 --- a/docker.run.sh +++ b/docker.run.sh @@ -2,7 +2,7 @@ IP=192.168.88.10 docker run --net=host \ -ti \ - -e LOG_LEVEL=ALL \ + -e LOG_LEVEL=all \ -e REDIS_HOST=$IP \ -e RAW_DESTINATION_HOST=$IP \ -e RAW_DESTINATION_UDP_PORT=5555 \ diff --git a/ferrum.io.sh b/ferrum.io.sh index 1b94d2c..5adf785 100644 --- a/ferrum.io.sh +++ b/ferrum.io.sh @@ -17,7 +17,7 @@ if [ ! -z "$REDIS_HOST" ]; then fi echo "redis host $OPT_REDIS_HOST" -OPT_LOG_LEVEL="INFO" +OPT_LOG_LEVEL="info" if [ ! -z "$LOG_LEVEL" ]; then OPT_LOG_LEVEL=$LOG_LEVEL fi diff --git a/src/main.c b/src/main.c index 49e479e..47fde72 100644 --- a/src/main.c +++ b/src/main.c @@ -28,19 +28,19 @@ static void set_log_level() { size_t log_level_size = sizeof(log_level); uv_os_getenv("LOG_LEVEL", log_level, &log_level_size); log_level_t level = REBRICK_LOG_ERROR; - if (!strcmp(log_level, "OFF")) + if (!strcmp(log_level, "off")) level = REBRICK_LOG_OFF; - if (!strcmp(log_level, "FATAL")) + if (!strcmp(log_level, "fatal")) level = REBRICK_LOG_FATAL; - if (!strcmp(log_level, "ERROR")) + if (!strcmp(log_level, "error")) level = REBRICK_LOG_ERROR; - if (!strcmp(log_level, "WARN")) + if (!strcmp(log_level, "warn")) level = REBRICK_LOG_WARN; - if (!strcmp(log_level, "INFO")) + if (!strcmp(log_level, "info")) level = REBRICK_LOG_INFO; - if (!strcmp(log_level, "DEBUG")) + if (!strcmp(log_level, "debug")) level = REBRICK_LOG_DEBUG; - if (!strcmp(log_level, "ALL")) + if (!strcmp(log_level, "all")) level = REBRICK_LOG_ALL; // set log level rebrick_log_level(level);