Conditions | 4 |
Total Lines | 10 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import logging |
||
9 | |||
10 | |||
11 | class TelegramHandler(Handler): |
||
12 | def emit(self, record: LogRecord) -> None: |
||
13 | log_entry = self.format(record) |
||
14 | token = os.environ["TG_TOKEN"] |
||
15 | chat_ids = os.environ["TG_CHATS"].split(",") |
||
16 | notifications = False |
||
17 | if record.levelno < 30: |
||
18 | notifications = True |
||
19 | for chat in chat_ids: |
||
52 |