diff options
author | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-11-03 08:09:08 +0100 |
---|---|---|
committer | Cédric Bonhomme <cedric@cedricbonhomme.org> | 2016-11-03 08:09:08 +0100 |
commit | 9c36e268e3a7927aed7e5e3cb57000a6e39bbe73 (patch) | |
tree | c86e2b19553ac4dda28662c4c0dbb47d5a992f02 /src/conf.py | |
parent | useless return (diff) | |
download | newspipe-9c36e268e3a7927aed7e5e3cb57000a6e39bbe73.tar.gz newspipe-9c36e268e3a7927aed7e5e3cb57000a6e39bbe73.tar.bz2 newspipe-9c36e268e3a7927aed7e5e3cb57000a6e39bbe73.zip |
Starting to improve the loging for Heroku (with logging.StreamHandler).
Diffstat (limited to 'src/conf.py')
-rw-r--r-- | src/conf.py | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/conf.py b/src/conf.py index 9bb05094..9718f07c 100644 --- a/src/conf.py +++ b/src/conf.py @@ -75,13 +75,21 @@ ADMIN_EMAIL = config.get('misc', 'admin_email') SELF_REGISTRATION = config.getboolean('misc', 'self_registration') SECURITY_PASSWORD_SALT = config.get('misc', 'security_password_salt') TOKEN_VALIDITY_PERIOD = config.getint('misc', 'token_validity_period') -LOG_PATH = os.path.abspath(config.get('misc', 'log_path')) NB_WORKER = config.getint('misc', 'nb_worker') -API_LOGIN = config.get('crawler', 'api_login') -API_PASSWD = config.get('crawler', 'api_passwd') +if not ON_HEROKU: + LOG_PATH = os.path.abspath(config.get('misc', 'log_path')) +else: + LOG_PATH = '' +LOG_LEVEL = {'debug': logging.DEBUG, + 'info': logging.INFO, + 'warn': logging.WARN, + 'error': logging.ERROR, + 'fatal': logging.FATAL}[config.get('misc', 'log_level')] SQLALCHEMY_DATABASE_URI = config.get('database', 'database_url') +API_LOGIN = config.get('crawler', 'api_login') +API_PASSWD = config.get('crawler', 'api_passwd') USER_AGENT = config.get('crawler', 'user_agent') DEFAULT_MAX_ERROR = config.getint('crawler', 'default_max_error') @@ -89,11 +97,7 @@ ERROR_THRESHOLD = int(DEFAULT_MAX_ERROR / 2) CRAWLING_METHOD = config.get('crawler', 'crawling_method') -LOG_LEVEL = {'debug': logging.DEBUG, - 'info': logging.INFO, - 'warn': logging.WARN, - 'error': logging.ERROR, - 'fatal': logging.FATAL}[config.get('misc', 'log_level')] + WEBSERVER_HOST = config.get('webserver', 'host') WEBSERVER_PORT = config.getint('webserver', 'port') |