Skip to content

Commit

Permalink
improve log message (#1709)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrobinAV committed Aug 27, 2024
1 parent 2698632 commit d8d14d0
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions taipy/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,15 @@ def _register(cls, section):

@classmethod
def _override_env_file(cls):
if config_filename := os.environ.get(cls._ENVIRONMENT_VARIABLE_NAME_WITH_CONFIG_PATH):
cls.__logger.info(f"Loading configuration provided by environment variable. Filename: '{config_filename}'")
cls._env_file_config = cls._serializer._read(config_filename)
cls.__logger.info(f"Configuration '{config_filename}' successfully loaded.")
if cfg_filename := os.environ.get(cls._ENVIRONMENT_VARIABLE_NAME_WITH_CONFIG_PATH):
if not os.path.exists(cfg_filename):
cls.__logger.error(f"File '{cfg_filename}' provided by environment variable "
f"'{cls._ENVIRONMENT_VARIABLE_NAME_WITH_CONFIG_PATH}' does not exist. "
f"No configuration will be loaded from environment variable.")
return
cls.__logger.info(f"Loading configuration provided by environment variable. Filename: '{cfg_filename}'")
cls._env_file_config = cls._serializer._read(cfg_filename)
cls.__logger.info(f"Configuration '{cfg_filename}' successfully loaded.")

@classmethod
def _compile_configs(cls):
Expand Down

0 comments on commit d8d14d0

Please sign in to comment.