Conditions | 3 |
Total Lines | 10 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import logging |
||
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: |
||
20 | requests.get( |
||
21 | f"https://api.telegram.org/bot{token}/sendMessage?chat_id=" |
||
22 | f"{chat}&text" |
||
52 |