core (logging): new backend_data parameter can be used to transmit specific data to a backend + Twisted backend use this option to know if we are in debug or nodaemon mode

This commit is contained in:
Goffi 2014-08-25 17:21:03 +02:00
commit d549533f00

View file

@ -155,7 +155,7 @@ class FilterName(object):
class ConfigureBase(object):
LOGGER_CLASS = Logger
def __init__(self, level=None, fmt=None, output=None, logger=None, colors=False, force_colors=False):
def __init__(self, level=None, fmt=None, output=None, logger=None, colors=False, force_colors=False, backend_data=None):
"""Configure a backend
@param level: one of C.LOG_LEVELS
@ -168,6 +168,7 @@ class ConfigureBase(object):
@param colors: if True use ANSI colors to show log levels
@param force_colors: if True ANSI colors are used even if stdout is not a tty
"""
self.backend_data = backend_data
self.preTreatment()
self.configureLevel(level)
self.configureFormat(fmt)