Skip to content
Snippets Groups Projects
Unverified Commit 37933a3b authored by Richard van der Hoff's avatar Richard van der Hoff Committed by GitHub
Browse files

Improve logging when generating config files (#5510)

Make it a bit clearer what's going on.
parent 5d6644ef
No related branches found
No related tags found
No related merge requests found
Improve logging when generating config files.
...@@ -289,6 +289,7 @@ class Config(object): ...@@ -289,6 +289,7 @@ class Config(object):
) )
(config_path,) = config_files (config_path,) = config_files
if not cls.path_exists(config_path): if not cls.path_exists(config_path):
print("Generating config file %s" % (config_path,))
if config_args.keys_directory: if config_args.keys_directory:
config_dir_path = config_args.keys_directory config_dir_path = config_args.keys_directory
else: else:
...@@ -331,7 +332,7 @@ class Config(object): ...@@ -331,7 +332,7 @@ class Config(object):
else: else:
print( print(
( (
"Config file %r already exists. Generating any missing key" "Config file %r already exists. Generating any missing config"
" files." " files."
) )
% (config_path,) % (config_path,)
......
...@@ -241,6 +241,7 @@ class KeyConfig(Config): ...@@ -241,6 +241,7 @@ class KeyConfig(Config):
signing_key_path = config["signing_key_path"] signing_key_path = config["signing_key_path"]
if not self.path_exists(signing_key_path): if not self.path_exists(signing_key_path):
print("Generating signing key file %s" % (signing_key_path,))
with open(signing_key_path, "w") as signing_key_file: with open(signing_key_path, "w") as signing_key_file:
key_id = "a_" + random_string(4) key_id = "a_" + random_string(4)
write_signing_keys(signing_key_file, (generate_signing_key(key_id),)) write_signing_keys(signing_key_file, (generate_signing_key(key_id),))
......
...@@ -137,6 +137,10 @@ class LoggingConfig(Config): ...@@ -137,6 +137,10 @@ class LoggingConfig(Config):
log_config = config.get("log_config") log_config = config.get("log_config")
if log_config and not os.path.exists(log_config): if log_config and not os.path.exists(log_config):
log_file = self.abspath("homeserver.log") log_file = self.abspath("homeserver.log")
print(
"Generating log config file %s which will log to %s"
% (log_config, log_file)
)
with open(log_config, "w") as log_config_file: with open(log_config, "w") as log_config_file:
log_config_file.write(DEFAULT_LOG_CONFIG.substitute(log_file=log_file)) log_config_file.write(DEFAULT_LOG_CONFIG.substitute(log_file=log_file))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment