pycommonlog 0.2.2__py3-none-any.whl → 0.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pycommonlog/__init__.py +2 -1
- pycommonlog/logger.py +2 -9
- pycommonlog/providers/lark.py +3 -13
- pycommonlog/providers/slack.py +1 -8
- {pycommonlog-0.2.2.dist-info → pycommonlog-0.2.3.dist-info}/METADATA +1 -1
- pycommonlog-0.2.3.dist-info/RECORD +13 -0
- pycommonlog-0.2.2.dist-info/RECORD +0 -13
- {pycommonlog-0.2.2.dist-info → pycommonlog-0.2.3.dist-info}/WHEEL +0 -0
- {pycommonlog-0.2.2.dist-info → pycommonlog-0.2.3.dist-info}/licenses/LICENSE +0 -0
- {pycommonlog-0.2.2.dist-info → pycommonlog-0.2.3.dist-info}/top_level.txt +0 -0
pycommonlog/__init__.py
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
commonlog: Unified logging and alerting for Slack/Lark (Python)
|
|
3
3
|
"""
|
|
4
4
|
|
|
5
|
-
from .log_types import SendMethod, AlertLevel, Attachment, Config, Provider, ChannelResolver, DefaultChannelResolver
|
|
5
|
+
from .log_types import SendMethod, AlertLevel, Attachment, Config, Provider, ChannelResolver, DefaultChannelResolver, LarkToken
|
|
6
6
|
from .providers import SlackProvider, LarkProvider
|
|
7
7
|
from .logger import commonlog
|
|
8
8
|
|
|
@@ -14,6 +14,7 @@ __all__ = [
|
|
|
14
14
|
"Provider",
|
|
15
15
|
"ChannelResolver",
|
|
16
16
|
"DefaultChannelResolver",
|
|
17
|
+
"LarkToken",
|
|
17
18
|
"SlackProvider",
|
|
18
19
|
"LarkProvider",
|
|
19
20
|
"commonlog"
|
pycommonlog/logger.py
CHANGED
|
@@ -2,16 +2,9 @@
|
|
|
2
2
|
Main logger for commonlog
|
|
3
3
|
"""
|
|
4
4
|
import logging
|
|
5
|
-
import sys
|
|
6
|
-
import os
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
if _current_dir not in sys.path:
|
|
11
|
-
sys.path.insert(0, _current_dir)
|
|
12
|
-
|
|
13
|
-
from providers import SlackProvider, LarkProvider
|
|
14
|
-
from log_types import AlertLevel, Attachment, debug_log
|
|
6
|
+
from pycommonlog.providers import SlackProvider, LarkProvider
|
|
7
|
+
from pycommonlog.log_types import AlertLevel, Attachment, debug_log
|
|
15
8
|
|
|
16
9
|
# ====================
|
|
17
10
|
# Configuration and Logger
|
pycommonlog/providers/lark.py
CHANGED
|
@@ -3,23 +3,13 @@ Lark Provider for commonlog
|
|
|
3
3
|
"""
|
|
4
4
|
import requests
|
|
5
5
|
import json
|
|
6
|
-
import sys
|
|
7
|
-
import os
|
|
8
6
|
import time
|
|
9
7
|
import threading
|
|
10
8
|
from typing import Dict, Optional, Tuple
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
if _parent_dir not in sys.path:
|
|
16
|
-
sys.path.insert(0, _parent_dir)
|
|
17
|
-
if _current_dir not in sys.path:
|
|
18
|
-
sys.path.insert(0, _current_dir)
|
|
19
|
-
|
|
20
|
-
from log_types import SendMethod, Provider, debug_log
|
|
21
|
-
from redis_client import get_redis_client, RedisConfigError
|
|
22
|
-
from cache import get_memory_cache
|
|
10
|
+
from pycommonlog.log_types import SendMethod, Provider, debug_log
|
|
11
|
+
from pycommonlog.providers.redis_client import get_redis_client, RedisConfigError
|
|
12
|
+
from pycommonlog.cache import get_memory_cache
|
|
23
13
|
|
|
24
14
|
class LarkProvider(Provider):
|
|
25
15
|
def send_to_channel(self, level, message, attachment, config, channel):
|
pycommonlog/providers/slack.py
CHANGED
|
@@ -2,15 +2,8 @@
|
|
|
2
2
|
Slack Provider for commonlog
|
|
3
3
|
"""
|
|
4
4
|
import requests
|
|
5
|
-
import sys
|
|
6
|
-
import os
|
|
7
5
|
|
|
8
|
-
|
|
9
|
-
_parent_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
|
10
|
-
if _parent_dir not in sys.path:
|
|
11
|
-
sys.path.insert(0, _parent_dir)
|
|
12
|
-
|
|
13
|
-
from log_types import SendMethod, Provider, debug_log
|
|
6
|
+
from pycommonlog.log_types import SendMethod, Provider, debug_log
|
|
14
7
|
|
|
15
8
|
class SlackProvider(Provider):
|
|
16
9
|
def send_to_channel(self, level, message, attachment, config, channel):
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
pycommonlog/__init__.py,sha256=DEPd0ZxJ5B3hbqMQXzB9031CkBAFwBBJ_LwIjgzJAgc,508
|
|
2
|
+
pycommonlog/cache.py,sha256=UFmwZ2gtsHwn1b0IOUYr4m1v_wnuey4TeMW44m2c-XI,2662
|
|
3
|
+
pycommonlog/log_types.py,sha256=j8YgqsvIHfpdYexH2reTuG4QsZi1vWtk5hkkBD6mYVM,2661
|
|
4
|
+
pycommonlog/logger.py,sha256=x-4WGsuVcmVRikJAYYcPVQ2NqHsetIPkX4AlulKVinc,6960
|
|
5
|
+
pycommonlog/providers/__init__.py,sha256=NfIV3103q6ZMPMiJCeS_I9sPZ7XQNyk3bFSe0Kh4xPE,148
|
|
6
|
+
pycommonlog/providers/lark.py,sha256=p1PMIJOzf9SDJMweN0nOsWx9UXwj4AtSRrtYkCZ8d-8,12210
|
|
7
|
+
pycommonlog/providers/redis_client.py,sha256=rOkj4_Wpa13scyqtTyDpkkZjXGbnA5iiX4hzcCUcUY8,1855
|
|
8
|
+
pycommonlog/providers/slack.py,sha256=MoyTcE_Y0aFg31uXqsAV_6VF9NCXPwZTcdEb5Ofr02E,4728
|
|
9
|
+
pycommonlog-0.2.3.dist-info/licenses/LICENSE,sha256=bxyMRuc_Y6GKeCFV0_vcJf24FqyCVNL_mtUaJ7lfuFo,1075
|
|
10
|
+
pycommonlog-0.2.3.dist-info/METADATA,sha256=JWYKk05du9a3gxHaaeW_Tshf330ZUI2JGkiSfoSgYAQ,9733
|
|
11
|
+
pycommonlog-0.2.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
+
pycommonlog-0.2.3.dist-info/top_level.txt,sha256=tHB8NrMYpDeBGSIsRB3JZ17XMlpdTZWKQ-Ejdg_wUb4,12
|
|
13
|
+
pycommonlog-0.2.3.dist-info/RECORD,,
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
pycommonlog/__init__.py,sha256=ide8ECcqnHuEbimAz5yT5GIGYWyEVlrxkefvxcFLYII,480
|
|
2
|
-
pycommonlog/cache.py,sha256=UFmwZ2gtsHwn1b0IOUYr4m1v_wnuey4TeMW44m2c-XI,2662
|
|
3
|
-
pycommonlog/log_types.py,sha256=j8YgqsvIHfpdYexH2reTuG4QsZi1vWtk5hkkBD6mYVM,2661
|
|
4
|
-
pycommonlog/logger.py,sha256=4b3mBTIUoxZsew8sOGN1IRniUgzOX-wxIJBpHMKmTfY,7137
|
|
5
|
-
pycommonlog/providers/__init__.py,sha256=NfIV3103q6ZMPMiJCeS_I9sPZ7XQNyk3bFSe0Kh4xPE,148
|
|
6
|
-
pycommonlog/providers/lark.py,sha256=3h2u5lziJUu4cE7HapuCqGQ9qn-zu--_lUSDXX9yjRg,12464
|
|
7
|
-
pycommonlog/providers/redis_client.py,sha256=rOkj4_Wpa13scyqtTyDpkkZjXGbnA5iiX4hzcCUcUY8,1855
|
|
8
|
-
pycommonlog/providers/slack.py,sha256=8AgBa4Sc74hKPsl6avxO6SpmwhByQ7b1pWYTSX26Tnc,4923
|
|
9
|
-
pycommonlog-0.2.2.dist-info/licenses/LICENSE,sha256=bxyMRuc_Y6GKeCFV0_vcJf24FqyCVNL_mtUaJ7lfuFo,1075
|
|
10
|
-
pycommonlog-0.2.2.dist-info/METADATA,sha256=6KN4mrCiQO2eLi0Wguus5mrXScXvVGIANtS-SpeuuD4,9733
|
|
11
|
-
pycommonlog-0.2.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
12
|
-
pycommonlog-0.2.2.dist-info/top_level.txt,sha256=tHB8NrMYpDeBGSIsRB3JZ17XMlpdTZWKQ-Ejdg_wUb4,12
|
|
13
|
-
pycommonlog-0.2.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|