driftwood.formatters package¶
Submodules¶
driftwood.formatters.dict module¶
- class driftwood.formatters.dict.DictFormatter(*args, regular_attrs=None, extra_attrs=, []**kwargs)[source]¶
Bases: logging.Formatter
Used for formatting log records into a dict.
Parameters: - regular_attrs (list) – A list of strings specifying built-in python logging args that should be included in each output dict. If not specified, all args will be used. Setting to an empty list will disable regular args.
- extra_attrs (list) – A list of strings specifying additional arguments that may exist on the log record instances and should be included in the messages.
driftwood.formatters.json module¶
- class driftwood.formatters.json.JSONFormatter(*args, regular_attrs=None, extra_attrs=, []**kwargs)[source]¶
Bases: driftwood.formatters.dict.DictFormatter
Formats messages as JSON.
Accepts the same arguments as DictFormatter
Parameters: - regular_attrs (list) – A list of strings specifying built-in python logging args that should be included in each output dict. If not specified, all args will be used. Setting to an empty list will disable regular args.
- extra_attrs (list) – A list of strings specifying additional arguments that may exist on the log record instances and should be included in the messages.
Module contents¶
- class driftwood.formatters.DictFormatter(*args, regular_attrs=None, extra_attrs=, []**kwargs)¶
Bases: logging.Formatter
Used for formatting log records into a dict.
Parameters: - regular_attrs (list) – A list of strings specifying built-in python logging args that should be included in each output dict. If not specified, all args will be used. Setting to an empty list will disable regular args.
- extra_attrs (list) – A list of strings specifying additional arguments that may exist on the log record instances and should be included in the messages.
- format(record)¶
Formats a log record into a dictionary using the arguments given to __init__.
- class driftwood.formatters.JSONFormatter(*args, regular_attrs=None, extra_attrs=, []**kwargs)¶
Bases: driftwood.formatters.dict.DictFormatter
Formats messages as JSON.
Accepts the same arguments as DictFormatter
Parameters: - regular_attrs (list) – A list of strings specifying built-in python logging args that should be included in each output dict. If not specified, all args will be used. Setting to an empty list will disable regular args.
- extra_attrs (list) – A list of strings specifying additional arguments that may exist on the log record instances and should be included in the messages.
- format(record)¶