Mercurial > libervia-backend
comparison sat/core/log.py @ 3280:96b9b65b4368
core (log): logging with Twisted now uses the new twisted.logger
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 25 May 2020 15:46:21 +0200 |
parents | 559a625a236b |
children | be6d91572633 |
comparison
equal
deleted
inserted
replaced
3279:8de63fe6b5c9 | 3280:96b9b65b4368 |
---|---|
35 | 35 |
36 class Filtered(Exception): | 36 class Filtered(Exception): |
37 pass | 37 pass |
38 | 38 |
39 | 39 |
40 class Logger(object): | 40 class Logger: |
41 """High level logging class""" | 41 """High level logging class""" |
42 fmt = None # format option as given by user (e.g. SAT_LOG_LOGGER) | 42 fmt = None # format option as given by user (e.g. SAT_LOG_LOGGER) |
43 filter_name = None # filter to call | 43 filter_name = None # filter to call |
44 post_treat = None | 44 post_treat = None |
45 | 45 |
161 log_record = LogRecord() | 161 log_record = LogRecord() |
162 log_record.name = dict_record['name'] | 162 log_record.name = dict_record['name'] |
163 return self.filter(log_record) == 1 | 163 return self.filter(log_record) == 1 |
164 | 164 |
165 | 165 |
166 class ConfigureBase(object): | 166 class ConfigureBase: |
167 LOGGER_CLASS = Logger | 167 LOGGER_CLASS = Logger |
168 # True if color location is specified in fmt (with COLOR_START) | 168 # True if color location is specified in fmt (with COLOR_START) |
169 _color_location = False | 169 _color_location = False |
170 | 170 |
171 def __init__(self, level=None, fmt=None, output=None, logger=None, colors=False, | 171 def __init__(self, level=None, fmt=None, output=None, logger=None, colors=False, |