Added debug messages for get_user_config
* Added debug messages for get_user_config
Fixes:
* Logger spelling. (Logs logged before action.
@@ -103,10 +103,12 @@ def get_user_config(config_file=None, default_config=False):
"""
# Do NOT load a config. Return defaults instead.
if default_config:
+ logger.debug("Force ignoring user config with default_config switch.")
return copy.copy(DEFAULT_CONFIG)
# Load the given config file
if config_file and config_file is not USER_CONFIG_PATH:
+ logger.debug("Loading custom config from %s.", config_file)
return get_config(config_file)
try:
@@ -116,10 +118,13 @@ def get_user_config(config_file=None, default_config=False):
# Load an optional user config if it exists
# otherwise return the defaults
if os.path.exists(USER_CONFIG_PATH):
+ logger.debug("Loading config from %s.", USER_CONFIG_PATH)
return get_config(USER_CONFIG_PATH)
else:
+ logger.debug("User config not found. Loading default config.")
return copy.copy(DEFAULT_CONFIG)
else:
# There is a config environment variable. Try to load it.
# Do not check for existence, so invalid file paths raise an error.
+ logger.debug("User config not found or not specified. Loading default config.")
return get_config(env_config_file)
