mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-21 07:55:00 +00:00
log: Allow setting the default log level before log configuration
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
e5177289dc
commit
a145742ebc
@ -11,6 +11,8 @@ import cherrypy
|
||||
|
||||
from . import cfg
|
||||
|
||||
default_level = None
|
||||
|
||||
|
||||
class ColoredFormatter(logging.Formatter):
|
||||
"""Print parts of log message in color."""
|
||||
@ -105,7 +107,7 @@ def get_configuration():
|
||||
},
|
||||
'root': {
|
||||
'handlers': ['console'],
|
||||
'level': 'DEBUG' if cfg.develop else 'INFO'
|
||||
'level': default_level or ('DEBUG' if cfg.develop else 'INFO')
|
||||
},
|
||||
'loggers': {
|
||||
'django.db.backends': {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user