From 5bf454badaa473e01776a9011812d3b5d3da3686 Mon Sep 17 00:00:00 2001 From: Yunkon Kim Date: Wed, 31 Jul 2024 16:10:17 +0900 Subject: [PATCH] Update regarding environment variables * Update several prefixes in `.env` * Apply the tumblebug env prefix `TB_` to logger initialization --- .env | 8 +++----- src/core/common/logger/logger.go | 2 ++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.env b/.env index 884e7cc9b..32f0cbd09 100644 --- a/.env +++ b/.env @@ -73,12 +73,10 @@ COMPOSE_SP_PLUGSIN_SW=${PLUGSIN_SW:-OFF} # default: COMPOSE_SP_PLUGSIN_SW COMPOSE_SP_SERVER_ADDRESS=${SERVER_ADDRESS:-localhost} # default: COMPOSE_SP_SERVER_ADDRESS=localhost -COMPOSE_SP_TB_API_USERNAME=${SP_TB_API_USERNAME:-} -# default: COMPOSE_SP_TB_API_USERNAME= -# Note - Use SP_TB_API_USERNAME instead of TB_API_USERNAME because TB_API_USERNAME is used in CB-Tumblebug -COMPOSE_SP_API_PASSWORD=${SP_API_PASSWORD:-} +COMPOSE_SP_API_USERNAME=${API_USERNAME:-} +# default: COMPOSE_SP_API_USERNAME= +COMPOSE_SP_API_PASSWORD=${API_PASSWORD:-} # default: COMPOSE_SP_API_PASSWORD= -# Note - Use SP_API_PASSWORD instead of TB_API_PASSWORD because TB_API_PASSWORD is used in CB-Tumblebug COMPOSE_SP_LOG_LEVEL=${LOG_LEVEL:-error} # default: COMPOSE_SP_LOG_LEVEL=error COMPOSE_SP_HISCALL_LOG_LEVEL=${HISCALL_LOG_LEVEL:-error} diff --git a/src/core/common/logger/logger.go b/src/core/common/logger/logger.go index 27697efea..2b8b7d3bd 100644 --- a/src/core/common/logger/logger.go +++ b/src/core/common/logger/logger.go @@ -19,6 +19,8 @@ var ( func init() { // Map environment variable names to config file key names + envPrefix := "TB" + viper.SetEnvPrefix(envPrefix) replacer := strings.NewReplacer(".", "_") viper.SetEnvKeyReplacer(replacer)