add_log_severity#
- safir.logging.add_log_severity(logger, method_name, event_dict)#
- Add the log level to the event dict as - severity.- Intended for use as a structlog processor. - This is the same as - structlog.stdlib.add_log_levelexcept that it uses the- severitykey rather than- levelfor compatibility with Google Log Explorer and its automatic processing of structured logs.- Parameters:
- logger ( - Logger) – The wrapped logger object.
- method_name ( - str) – The name of the wrapped method (- warningor- error, for example).
- event_dict ( - MutableMapping[- str,- Any]) – Current context and current event. This parameter is also modified in place, matching the normal behavior of structlog processors.
 
- Returns:
- The modified - structlog.types.EventDictwith the added key.
- Return type:
- structlog.types.EventDict