core: log filenames of read config files
This commit is contained in:
parent
3d86f0c983
commit
ec5a51bebb
1 changed files with 13 additions and 4 deletions
|
|
@ -99,13 +99,22 @@ def fixLocalDir(silent=True):
|
|||
fixConfigOption("", "local_dir", old_default, silent)
|
||||
|
||||
|
||||
def parseMainConf():
|
||||
"""look for main .ini configuration file, and parse it"""
|
||||
def parseMainConf(log_filenames=False):
|
||||
"""Look for main .ini configuration file, and parse it
|
||||
|
||||
@param log_filenames(bool): if True, log filenames of read config files
|
||||
"""
|
||||
config = ConfigParser(defaults=C.DEFAULT_CONFIG)
|
||||
try:
|
||||
config.read(C.CONFIG_FILES)
|
||||
filenames = config.read(C.CONFIG_FILES)
|
||||
except Exception as e:
|
||||
log.error(_("Can't read main config: {msg}").format(msg=e), exc_info=True)
|
||||
else:
|
||||
if log_filenames:
|
||||
log.info(
|
||||
_("Configuration was read from: {filenames}").format(
|
||||
filenames=', '.join(filenames)))
|
||||
|
||||
return config
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue