Add logging for loading / saving config file.

This commit is contained in:
voussoir 2021-10-01 14:14:21 -07:00
parent fd42ef16e1
commit 1f7e299821
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -2034,6 +2034,7 @@ class PhotoDB(
return new_id return new_id
def load_config(self) -> None: def load_config(self) -> None:
self.log.debug('Loading config file.')
(config, needs_rewrite) = configlayers.load_file( (config, needs_rewrite) = configlayers.load_file(
filepath=self.config_filepath, filepath=self.config_filepath,
default_config=constants.DEFAULT_CONFIGURATION, default_config=constants.DEFAULT_CONFIGURATION,
@ -2044,5 +2045,6 @@ class PhotoDB(
self.save_config() self.save_config()
def save_config(self) -> None: def save_config(self) -> None:
self.log.debug('Saving config file.')
with self.config_filepath.open('w', encoding='utf-8') as handle: with self.config_filepath.open('w', encoding='utf-8') as handle:
handle.write(json.dumps(self.config, indent=4, sort_keys=True)) handle.write(json.dumps(self.config, indent=4, sort_keys=True))