diff src/core/log.py @ 1129:08f50fdac21b

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
author Goffi <goffi@goffi.org>
date Mon, 25 Aug 2014 17:21:03 +0200
parents a836b6da2c5c
children 069ad98b360d
line wrap: on
line diff
--- a/src/core/log.py	Mon Aug 25 17:21:03 2014 +0200
+++ b/src/core/log.py	Mon Aug 25 17:21:03 2014 +0200
@@ -155,7 +155,7 @@
 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 @@
         @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)