From bd1665a8497cb9412bd8327623aeb8f70350ed7f Mon Sep 17 00:00:00 2001 From: Hay1tsme Date: Fri, 24 Feb 2023 14:10:41 -0500 Subject: [PATCH] add logging levels for index.py and read.py --- index.py | 6 +++--- read.py | 5 +++-- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/index.py b/index.py index da1a11b..689e9ee 100644 --- a/index.py +++ b/index.py @@ -105,9 +105,9 @@ if __name__ == "__main__": logger.addHandler(fileHandler) logger.addHandler(consoleHandler) - # TODO: Add log level for core to config - logger.setLevel(cfg.allnet.loglevel) - coloredlogs.install(level=cfg.allnet.loglevel, logger=logger, fmt=log_fmt_str) + log_lv = logging.DEBUG if cfg.server.is_develop else logging.INFO + logger.setLevel(log_lv) + coloredlogs.install(level=log_lv, logger=logger, fmt=log_fmt_str) logger.initialized = True if not path.exists(cfg.server.log_dir): diff --git a/read.py b/read.py index cec8634..869ad97 100644 --- a/read.py +++ b/read.py @@ -94,8 +94,9 @@ if __name__ == "__main__": logger.addHandler(fileHandler) logger.addHandler(consoleHandler) - logger.setLevel(logging.INFO) - coloredlogs.install(level=logging.INFO, logger=logger, fmt=log_fmt_str) + log_lv = logging.DEBUG if config.server.is_develop else logging.INFO + logger.setLevel(log_lv) + coloredlogs.install(level=log_lv, logger=logger, fmt=log_fmt_str) if args.series is None or args.version is None: logger.error("Game or version not specified")