filter logging down to project-only loggers, improve logging format and add colored-traceback

This commit is contained in:
Xevion
2020-08-28 16:34:32 -05:00
parent 6e91f0f928
commit 68ded24c6f
3 changed files with 9 additions and 3 deletions
+7 -3
View File
@@ -10,8 +10,12 @@ import os
from . import config
log = logging.getLogger("init")
log.setLevel(logging.INFO)
logging.basicConfig(
format='[%(asctime)s] [%(name)s] [%(levelname)s] %(message)s',
level=logging.ERROR
)
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
# Path Constants
ROOT = os.getcwd()
@@ -19,7 +23,7 @@ INPUT_PATH = ROOT
SCRIPT_ROOT = os.path.dirname(os.path.realpath(__file__))
TEMP_PATH = os.path.join(ROOT, "temp")
OUTPUT_PATH = os.path.join(ROOT, "output")
log.info("Path constants built successfully...")
logger.info("Path constants built successfully...")
# Environment Variables
os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = os.path.join(SCRIPT_ROOT, "config",
+1
View File
@@ -7,3 +7,4 @@ Pillow>=7.1.0
protobuf==3.11.3
google-cloud-vision~=2.0
google-api-python-client~=1.12.3
colored-traceback~=0.3.0
+1
View File
@@ -18,6 +18,7 @@ DEPENDENCIES = [
"google-cloud",
"google-cloud-vision",
"Pillow",
"colored-traceback"
]
EXCLUDE_FROM_PACKAGES = []
CURDIR = sys.path[0]