Skip to content

Commit

Permalink
changed log level to lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
dev ferrumgate committed Nov 21, 2022
1 parent b605704 commit 85c5f64
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"environment": [
{
"name": "LOG_LEVEL",
"value": "ALL"
"value": "all"
},
{
"name": "REDIS_HOST",
Expand Down
2 changes: 1 addition & 1 deletion docker.run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
2 changes: 1 addition & 1 deletion ferrum.io.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 7 additions & 7 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 85c5f64

Please sign in to comment.