Revamp the logging a bit. Not quite done yet.
This commit is contained in:
parent
3fb4fafb33
commit
a5a61576ae
10 changed files with 91 additions and 52 deletions
15
config.py
15
config.py
|
@ -1,5 +1,4 @@
|
|||
import logging
|
||||
import logstash_formatter
|
||||
import requests
|
||||
import os.path
|
||||
|
||||
|
@ -16,18 +15,6 @@ def build_requests_session():
|
|||
return sess
|
||||
|
||||
|
||||
def logs_init_builder(level=logging.DEBUG,
|
||||
formatter=logstash_formatter.LogstashFormatter()):
|
||||
@staticmethod
|
||||
def init_logs():
|
||||
handler = logging.StreamHandler()
|
||||
root_logger = logging.getLogger('')
|
||||
root_logger.setLevel(level)
|
||||
handler.setFormatter(formatter)
|
||||
root_logger.addHandler(handler)
|
||||
|
||||
return init_logs
|
||||
|
||||
# The set of configuration key names that will be accessible in the client. Since these
|
||||
# values are set to the frontend, DO NOT PLACE ANY SECRETS OR KEYS in this list.
|
||||
CLIENT_WHITELIST = ['SERVER_HOSTNAME', 'PREFERRED_URL_SCHEME', 'GITHUB_CLIENT_ID',
|
||||
|
@ -53,7 +40,7 @@ class DefaultConfig(object):
|
|||
JSONIFY_PRETTYPRINT_REGULAR = False
|
||||
SESSION_COOKIE_SECURE = False
|
||||
|
||||
LOGGING_CONFIG = logs_init_builder(formatter=logging.Formatter())
|
||||
LOGGING_LEVEL = 'DEBUG'
|
||||
SEND_FILE_MAX_AGE_DEFAULT = 0
|
||||
POPULATE_DB_TEST_DATA = True
|
||||
PREFERRED_URL_SCHEME = 'http'
|
||||
|
|
Reference in a new issue