From 035f96461acf3e89bb448e673279c69758c19bf5 Mon Sep 17 00:00:00 2001 From: Stefan Allius Date: Thu, 1 May 2025 16:58:48 +0200 Subject: [PATCH] store logging path in Config class --- app/src/cnf/config.py | 7 ++++++- app/src/server.py | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/cnf/config.py b/app/src/cnf/config.py index 88a0ab0..5207c7d 100644 --- a/app/src/cnf/config.py +++ b/app/src/cnf/config.py @@ -162,12 +162,13 @@ class Config(): ) @classmethod - def init(cls, def_reader: ConfigIfc) -> None | str: + def init(cls, def_reader: ConfigIfc, log_path: str = '') -> None | str: '''Initialise the Proxy-Config Copy the internal default config file into the config directory and initialise the Config with the default configuration ''' cls.err = None + cls.log_path = log_path cls.def_config = {} try: # make the default config transparaent by copying it @@ -247,3 +248,7 @@ here. The default config reader is handled in the Config.init method''' '''Check if the member is the default value''' return cls.act_config.get(member) == cls.def_config.get(member) + + @classmethod + def get_log_path(cls) -> str: + return cls.log_path diff --git a/app/src/server.py b/app/src/server.py index d1e62b0..abbe70f 100644 --- a/app/src/server.py +++ b/app/src/server.py @@ -179,7 +179,8 @@ def main(): # pragma: no cover asyncio.set_event_loop(loop) # read config file - Config.init(ConfigReadToml(src_dir + "cnf/default_config.toml")) + Config.init(ConfigReadToml(src_dir + "cnf/default_config.toml"), + log_path=args.log_path) ConfigReadEnv() ConfigReadJson(args.config_path + "config.json") ConfigReadToml(args.config_path + "config.toml")