comparison src/core/constants.py @ 1007:a7d33c7a8277

core (log): refactoring + twisted backend: - configuration is now done with classes, so inheritance is possible - twisted backend now use twisted log methods - log not produced by SàT directly in twisted backend are captured by an observer (twistedObserver) and sent back to SàT logging chain, with the "twisted" logger. - \\default output use normal twistd output, except in debug mode where it add an stdout output in addition to the log file. - when log_colors = True, colors are enabled only where it's possible (tty out), when log_colors=force colors are always enabled. - fixed some bad log.xxx calls
author Goffi <goffi@goffi.org>
date Mon, 05 May 2014 18:58:34 +0200
parents b4af31a8a4f2
children 73a0b7f94674
comparison
equal deleted inserted replaced
1006:325fd230c15d 1007:a7d33c7a8277
76 ## Logging ## 76 ## Logging ##
77 LOG_BACKEND_STANDARD = 'standard' 77 LOG_BACKEND_STANDARD = 'standard'
78 LOG_BACKEND_TWISTED = 'twisted' 78 LOG_BACKEND_TWISTED = 'twisted'
79 LOG_BACKEND_BASIC = 'basic' 79 LOG_BACKEND_BASIC = 'basic'
80 LOG_BASE_LOGGER = 'root' 80 LOG_BASE_LOGGER = 'root'
81 LOG_TWISTED_LOGGER = 'twisted'
81 LOG_OPT_PREFIX = 'log_' 82 LOG_OPT_PREFIX = 'log_'
82 # (option_name, default_value) tuples 83 # (option_name, default_value) tuples
83 LOG_OPT_COLORS = ('colors', 'true') # true for auto colors, force to have colors even if stdout is not a tty, false for no color 84 LOG_OPT_COLORS = ('colors', 'true') # true for auto colors, force to have colors even if stdout is not a tty, false for no color
84 LOG_OPT_LEVEL = ('level', 'info') 85 LOG_OPT_LEVEL = ('level', 'info')
85 LOG_OPT_FORMAT = ('fmt', '%(message)s') # similar to logging format. 86 LOG_OPT_FORMAT = ('fmt', '%(message)s') # similar to logging format.