(msg, level="DEBUG", message_prefix="")
| 2716 | |
| 2717 | |
| 2718 | def send_msg(msg, level="DEBUG", message_prefix=""): |
| 2719 | if setting.WARNING_LEVEL == "ERROR": |
| 2720 | if level.upper() != "ERROR": |
| 2721 | return |
| 2722 | |
| 2723 | if setting.DINGDING_WARNING_URL: |
| 2724 | keyword = "feapder报警系统\n" |
| 2725 | dingding_warning(keyword + msg, message_prefix=message_prefix) |
| 2726 | |
| 2727 | if setting.EMAIL_RECEIVER: |
| 2728 | title = message_prefix or msg |
| 2729 | if len(title) > 50: |
| 2730 | title = title[:50] + "..." |
| 2731 | email_warning(msg, message_prefix=message_prefix, title=title) |
| 2732 | |
| 2733 | if setting.WECHAT_WARNING_URL: |
| 2734 | keyword = "feapder报警系统\n" |
| 2735 | wechat_warning(keyword + msg, message_prefix=message_prefix) |
| 2736 | |
| 2737 | if setting.FEISHU_WARNING_URL: |
| 2738 | keyword = "feapder报警系统\n" |
| 2739 | feishu_warning(keyword + msg, message_prefix=message_prefix) |
| 2740 | |
| 2741 | |
| 2742 | ################### |
no test coverage detected