StdoutBackend
StdoutBackend wrapper
- class DIRAC.Resources.LogBackends.StdoutBackend.StdoutBackend(backendParams=None)
Bases:
DIRAC.Resources.LogBackends.AbstractBackend.AbstractBackend
StdoutBackend is used to create an abstraction of the handler and the formatter concepts from logging. Here, we gather a StreamHandler object and a BaseFormatter.
StreamHandler is from the standard logging library: it is used to write log messages in a desired stream so it needs a name: here it is stdout.
ColorBaseFormatter is a custom Formatter object, created for DIRAC in order to get the appropriate display with color. You can find it in FrameworkSystem/private/standardLogging/Formatter
- __init__(backendParams=None)
Initialization of the backend. _handler and _formatter can be custom objects. If it is the case, you can find them in FrameworkSystem/private/standardLogging/Formatter or Handler.
- Parameters
_handler – handler object from ‘logging’. Ex: StreamHandler(), FileHandler()…
_formatter – the name of a formatter object from logging. Ex: BaseFormatter
backendParams (dict) – parameters to set up the backend
_datefmt (str) – parameters to set up the formatter (e.g. fmt, the format, and datefmt, the date format)
_level (str) – level of the handler
- getHandler()
- Returns
the handler