Fix logging on import errors

This commit is contained in:
luukas 2021-04-17 23:34:13 +03:00
parent 500e537b18
commit 9049e44803
9 changed files with 15 additions and 15 deletions

View File

@ -17,8 +17,8 @@ try:
import requests import requests
except ModuleNotFoundError as e: except ModuleNotFoundError as e:
logger.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, e.name)) console.critical("Import Error: Unable to load {} module".format(e.name))
sys.exit(1) sys.exit(1)

View File

@ -16,7 +16,7 @@ try:
except ModuleNotFoundError as e: except ModuleNotFoundError as e:
logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) 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) sys.exit(1)

View File

@ -9,8 +9,8 @@ try:
from termcolor import colored from termcolor import colored
except ModuleNotFoundError as e: except ModuleNotFoundError as e:
logging.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)
print("Import Error: Unable to load {} module".format(e, e.name)) print("Import Error: Unable to load {} module".format(e.name))
from app.classes.shared.installer import installer from app.classes.shared.installer import installer
installer.do_install() installer.do_install()
sys.exit(1) sys.exit(1)

View File

@ -28,7 +28,7 @@ try:
except ModuleNotFoundError as e: except ModuleNotFoundError as e:
logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) 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) sys.exit(1)
class Helpers: class Helpers:

View File

@ -18,8 +18,8 @@ try:
import yaml import yaml
except ModuleNotFoundError as e: except ModuleNotFoundError as e:
logger.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, e.name)) console.critical("Import Error: Unable to load {} module".format(e.name))
sys.exit(1) sys.exit(1)
schema_version = (0, 1, 0) # major, minor, patch semver schema_version = (0, 1, 0) # major, minor, patch semver

View File

@ -23,8 +23,8 @@ try:
import pexpect import pexpect
except ModuleNotFoundError as e: except ModuleNotFoundError as e:
logger.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, e.name)) console.critical("Import Error: Unable to load {} module".format(e.name))
sys.exit(1) sys.exit(1)

View File

@ -21,7 +21,7 @@ try:
except ModuleNotFoundError as e: except ModuleNotFoundError as e:
logger.critical("Import Error: Unable to load {} module".format(e.name), exc_info=True) 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) sys.exit(1)
scheduler_intervals = { 'seconds', scheduler_intervals = { 'seconds',

View File

@ -15,8 +15,8 @@ try:
import bleach import bleach
except ModuleNotFoundError as e: except ModuleNotFoundError as e:
logger.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, e.name)) console.critical("Import Error: Unable to load {} module".format(e.name))
sys.exit(1) sys.exit(1)

View File

@ -19,8 +19,8 @@ try:
import bleach import bleach
except ModuleNotFoundError as e: except ModuleNotFoundError as e:
logger.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, e.name)) console.critical("Import Error: Unable to load {} module".format(e.name))
sys.exit(1) sys.exit(1)