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
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)

View File

@ -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)

View File

@ -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)

View File

@ -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:

View File

@ -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

View File

@ -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)

View File

@ -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',

View File

@ -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)

View File

@ -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)