21 lines
650 B
Python
21 lines
650 B
Python
from ...logging_config import get_logger
|
|
from ...redaction import redact_dict
|
|
from ...timeutil import payload_with_display_times
|
|
from .base import DeliveryResult
|
|
|
|
|
|
class DebugNotifier:
|
|
name = "debug"
|
|
|
|
def __init__(self, time_zone: str = "UTC") -> None:
|
|
self._log = get_logger("monlet.notifier.debug")
|
|
self._time_zone = time_zone
|
|
|
|
async def deliver(self, event_type: str, payload: dict) -> DeliveryResult:
|
|
self._log.info(
|
|
"notify",
|
|
event_type=event_type,
|
|
payload=redact_dict(payload_with_display_times(payload, self._time_zone)),
|
|
)
|
|
return DeliveryResult(ok=True)
|