Skip to content

Commit

Permalink
improve file handling
Browse files Browse the repository at this point in the history
- move default_config.toml into src/cnf/.
  • Loading branch information
s-allius committed Dec 23, 2024
1 parent b473ac5 commit 97ff048
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/src/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ def main(): # pragma: no cover

setattr(logging.handlers, "log_path", args.log_path)
setattr(logging.handlers, "log_backups", args.log_backups)
os.makedirs(args.log_path, exist_ok=True)

logging.config.fileConfig('logging.ini')
src_dir = os.path.dirname(__file__) + '/'
logging.config.fileConfig(src_dir + 'logging.ini')
logging.info(f'Server "{serv_name} - {version}" will be started')
logging.info(f'current dir: {os.getcwd()}')
logging.info(f"config_path: {args.config_path}")
Expand All @@ -184,7 +186,7 @@ def main(): # pragma: no cover
asyncio.set_event_loop(loop)

# read config file
Config.init(ConfigReadToml("default_config.toml"))
Config.init(ConfigReadToml(src_dir + "cnf/default_config.toml"))
ConfigReadEnv()
ConfigReadJson(args.config_path + "config.json")
ConfigReadToml(args.config_path + "config.toml")
Expand Down

0 comments on commit 97ff048

Please sign in to comment.