diff --git a/phototag/__init__.py b/phototag/__init__.py index 2a7a4ee..7240d25 100644 --- a/phototag/__init__.py +++ b/phototag/__init__.py @@ -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", diff --git a/requirements.txt b/requirements.txt index 48597aa..8465503 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/setup.py b/setup.py index e87b544..18963a2 100644 --- a/setup.py +++ b/setup.py @@ -18,6 +18,7 @@ DEPENDENCIES = [ "google-cloud", "google-cloud-vision", "Pillow", + "colored-traceback" ] EXCLUDE_FROM_PACKAGES = [] CURDIR = sys.path[0]