[cli] adds python logging facility configuration.

This commit is contained in:
Romain Dorgueil
2017-05-31 22:06:08 +02:00
parent 2c2bc4fca9
commit 88d46a724d
7 changed files with 122 additions and 27 deletions

View File

@ -1,5 +1,7 @@
import os
import logging
def to_bool(s):
if len(s):
@ -10,13 +12,16 @@ def to_bool(s):
# Debug/verbose mode.
DEBUG = to_bool(os.environ.get('BONOBO_DEBUG', 'f'))
DEBUG = to_bool(os.environ.get('DEBUG', 'f'))
# Profile mode.
PROFILE = to_bool(os.environ.get('BONOBO_PROFILE', 'f'))
PROFILE = to_bool(os.environ.get('PROFILE', 'f'))
# Quiet mode.
QUIET = to_bool(os.environ.get('BONOBO_QUIET', 'f'))
QUIET = to_bool(os.environ.get('QUIET', 'f'))
# Logging level.
LOGGING_LEVEL = logging.DEBUG if DEBUG else logging.INFO
def check():