From 9049e4480393d137511e1e6756428598477fdacf Mon Sep 17 00:00:00 2001 From: luukas Date: Sat, 17 Apr 2021 23:34:13 +0300 Subject: [PATCH] Fix logging on import errors --- app/classes/minecraft/serverjars.py | 4 ++-- app/classes/shared/cmd.py | 2 +- app/classes/shared/console.py | 4 ++-- app/classes/shared/helpers.py | 2 +- app/classes/shared/models.py | 4 ++-- app/classes/shared/server.py | 4 ++-- app/classes/shared/tasks.py | 2 +- app/classes/web/public_handler.py | 4 ++-- app/classes/web/server_handler.py | 4 ++-- 9 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/classes/minecraft/serverjars.py b/app/classes/minecraft/serverjars.py index 8c91cd96..dc76bffa 100644 --- a/app/classes/minecraft/serverjars.py +++ b/app/classes/minecraft/serverjars.py @@ -17,8 +17,8 @@ try: import requests except ModuleNotFoundError as e: - logger.critical("Import Error: Unable to load {} module".format(e, e.name)) - console.critical("Import Error: Unable to load {} module".format(e, e.name)) + logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) + console.critical("Import Error: Unable to load {} module".format(e.name)) sys.exit(1) diff --git a/app/classes/shared/cmd.py b/app/classes/shared/cmd.py index 7d2428b1..e8c1570f 100644 --- a/app/classes/shared/cmd.py +++ b/app/classes/shared/cmd.py @@ -16,7 +16,7 @@ try: except ModuleNotFoundError as e: logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) - console.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) + console.critical("Import Error: Unable to load {} module".format(e.name)) sys.exit(1) diff --git a/app/classes/shared/console.py b/app/classes/shared/console.py index 087cdcc4..18733adc 100644 --- a/app/classes/shared/console.py +++ b/app/classes/shared/console.py @@ -9,8 +9,8 @@ try: from termcolor import colored except ModuleNotFoundError as e: - logging.critical("Import Error: Unable to load {} module".format(e, e.name)) - print("Import Error: Unable to load {} module".format(e, e.name)) + logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) + print("Import Error: Unable to load {} module".format(e.name)) from app.classes.shared.installer import installer installer.do_install() sys.exit(1) diff --git a/app/classes/shared/helpers.py b/app/classes/shared/helpers.py index 1610869f..8ee0de64 100644 --- a/app/classes/shared/helpers.py +++ b/app/classes/shared/helpers.py @@ -28,7 +28,7 @@ try: except ModuleNotFoundError as e: logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) - console.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) + console.critical("Import Error: Unable to load {} module".format(e.name)) sys.exit(1) class Helpers: diff --git a/app/classes/shared/models.py b/app/classes/shared/models.py index 3336f235..b53c2903 100644 --- a/app/classes/shared/models.py +++ b/app/classes/shared/models.py @@ -18,8 +18,8 @@ try: import yaml except ModuleNotFoundError as e: - logger.critical("Import Error: Unable to load {} module".format(e, e.name)) - console.critical("Import Error: Unable to load {} module".format(e, e.name)) + logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) + console.critical("Import Error: Unable to load {} module".format(e.name)) sys.exit(1) schema_version = (0, 1, 0) # major, minor, patch semver diff --git a/app/classes/shared/server.py b/app/classes/shared/server.py index c770bf5d..7059a7a0 100644 --- a/app/classes/shared/server.py +++ b/app/classes/shared/server.py @@ -23,8 +23,8 @@ try: import pexpect except ModuleNotFoundError as e: - logger.critical("Import Error: Unable to load {} module".format(e, e.name)) - console.critical("Import Error: Unable to load {} module".format(e, e.name)) + logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) + console.critical("Import Error: Unable to load {} module".format(e.name)) sys.exit(1) diff --git a/app/classes/shared/tasks.py b/app/classes/shared/tasks.py index bc572379..660af321 100644 --- a/app/classes/shared/tasks.py +++ b/app/classes/shared/tasks.py @@ -21,7 +21,7 @@ try: except ModuleNotFoundError as e: logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) - console.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) + console.critical("Import Error: Unable to load {} module".format(e.name)) sys.exit(1) scheduler_intervals = { 'seconds', diff --git a/app/classes/web/public_handler.py b/app/classes/web/public_handler.py index 7afb8ace..035f6ac8 100644 --- a/app/classes/web/public_handler.py +++ b/app/classes/web/public_handler.py @@ -15,8 +15,8 @@ try: import bleach except ModuleNotFoundError as e: - logger.critical("Import Error: Unable to load {} module".format(e, e.name)) - console.critical("Import Error: Unable to load {} module".format(e, e.name)) + logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) + console.critical("Import Error: Unable to load {} module".format(e.name)) sys.exit(1) diff --git a/app/classes/web/server_handler.py b/app/classes/web/server_handler.py index 64c2d9ca..0d10299e 100644 --- a/app/classes/web/server_handler.py +++ b/app/classes/web/server_handler.py @@ -19,8 +19,8 @@ try: import bleach except ModuleNotFoundError as e: - logger.critical("Import Error: Unable to load {} module".format(e, e.name)) - console.critical("Import Error: Unable to load {} module".format(e, e.name)) + logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) + console.critical("Import Error: Unable to load {} module".format(e.name)) sys.exit(1)