mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-09-19 04:59:01 +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
|
from . import cfg
|
||||||
|
|
||||||
|
default_level = None
|
||||||
|
|
||||||
|
|
||||||
class ColoredFormatter(logging.Formatter):
|
class ColoredFormatter(logging.Formatter):
|
||||||
"""Print parts of log message in color."""
|
"""Print parts of log message in color."""
|
||||||
@ -105,7 +107,7 @@ def get_configuration():
|
|||||||
},
|
},
|
||||||
'root': {
|
'root': {
|
||||||
'handlers': ['console'],
|
'handlers': ['console'],
|
||||||
'level': 'DEBUG' if cfg.develop else 'INFO'
|
'level': default_level or ('DEBUG' if cfg.develop else 'INFO')
|
||||||
},
|
},
|
||||||
'loggers': {
|
'loggers': {
|
||||||
'django.db.backends': {
|
'django.db.backends': {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user