sawmill.formatter.field¶
-
class
sawmill.formatter.field.Field(keys, missing_key='__SKIP__', template='{key}={value}', item_separator=':')[source]¶ Bases:
sawmill.formatter.base.FormatterFormat
logsaccording to item list.-
REMAINING= '*'¶
-
__init__(keys, missing_key='__SKIP__', template='{key}={value}', item_separator=':')[source]¶ Initialise formatter with keys to look for in specific order.
keys may contain
REMAININGat any point to include all remaining unspecified keys in alphabetical order.missing_key determines how to handle a missing key when formatting a log. The default
SKIPwill skip the key and not include it in the resulting output.ERRORwill cause a KeyError to be raised. Any other value will be used as the substitute string for the missing value.template is used to format the key and value of each field and item_separator will separate each item.
-
ERROR= '__ERROR__'¶
-
SKIP= '__SKIP__'¶
-