Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit a7686af

Browse files
committed
Improve logging when generating config files (#5510)
2 parents 7feac0e + 37933a3 commit a7686af

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

changelog.d/5510.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improve logging when generating config files.

synapse/config/_base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ def load_or_generate_config(cls, description, argv):
290290
)
291291
(config_path,) = config_files
292292
if not cls.path_exists(config_path):
293+
print("Generating config file %s" % (config_path,))
293294
if config_args.keys_directory:
294295
config_dir_path = config_args.keys_directory
295296
else:
@@ -332,7 +333,7 @@ def load_or_generate_config(cls, description, argv):
332333
else:
333334
print(
334335
(
335-
"Config file %r already exists. Generating any missing key"
336+
"Config file %r already exists. Generating any missing config"
336337
" files."
337338
)
338339
% (config_path,)

synapse/config/key.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ def generate_files(self, config):
241241
signing_key_path = config["signing_key_path"]
242242

243243
if not self.path_exists(signing_key_path):
244+
print("Generating signing key file %s" % (signing_key_path,))
244245
with open(signing_key_path, "w") as signing_key_file:
245246
key_id = "a_" + random_string(4)
246247
write_signing_keys(signing_key_file, (generate_signing_key(key_id),))

synapse/config/logger.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,10 @@ def generate_files(self, config):
137137
log_config = config.get("log_config")
138138
if log_config and not os.path.exists(log_config):
139139
log_file = self.abspath("homeserver.log")
140+
print(
141+
"Generating log config file %s which will log to %s"
142+
% (log_config, log_file)
143+
)
140144
with open(log_config, "w") as log_config_file:
141145
log_config_file.write(DEFAULT_LOG_CONFIG.substitute(log_file=log_file))
142146

0 commit comments

Comments
 (0)