diff --git a/tubesync/common/logger.py b/tubesync/common/logger.py index 44deb26..a1fcf89 100644 --- a/tubesync/common/logger.py +++ b/tubesync/common/logger.py @@ -1,10 +1,14 @@ import logging +from django.conf import settings + + +logging_level = logging.DEBUG if settings.DEBUG else logging.INFO log = logging.getLogger('tubesync') -log.setLevel(logging.DEBUG) +log.setLevel(logging_level) ch = logging.StreamHandler() -ch.setLevel(logging.DEBUG) +ch.setLevel(logging_level) formatter = logging.Formatter('%(asctime)s [%(name)s/%(levelname)s] %(message)s') ch.setFormatter(formatter) log.addHandler(ch)