Revert "Add more verbosity levels"

This commit is contained in:
Matthias
2018-07-19 20:43:41 +02:00
committed by GitHub
parent 1af24af391
commit 90915b6b2f
6 changed files with 47 additions and 83 deletions

View File

@@ -12,22 +12,10 @@ from jsonschema import Draft4Validator, validate
from jsonschema.exceptions import ValidationError, best_match
from freqtrade import OperationalException, constants
logger = logging.getLogger(__name__)
def set_loggers(log_level: int = 0) -> None:
"""
Set the logger level for Third party libs
:return: None
"""
logging.getLogger('requests').setLevel(logging.INFO if log_level <= 1 else logging.DEBUG)
logging.getLogger("urllib3").setLevel(logging.INFO if log_level <= 1 else logging.DEBUG)
logging.getLogger('ccxt.base.exchange').setLevel(
logging.INFO if log_level <= 2 else logging.DEBUG)
logging.getLogger('telegram').setLevel(logging.INFO)
class Configuration(object):
"""
Class to read and init the bot configuration
@@ -93,10 +81,9 @@ class Configuration(object):
if 'loglevel' in self.args and self.args.loglevel:
config.update({'loglevel': self.args.loglevel})
logging.basicConfig(
level=logging.DEBUG,
level=config['loglevel'],
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
)
set_loggers(config['loglevel'])
logger.info('Log level set to %s', logging.getLevelName(config['loglevel']))
# Add dynamic_whitelist if found