python-sdk-local 0.0.25__tar.gz → 0.0.26__tar.gz
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.
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/PKG-INFO +1 -1
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/python_sdk_local.egg-info/PKG-INFO +1 -1
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/sdk/src/LoggerOutputEnum.py +1 -1
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/sdk/src/debug_mode.py +14 -12
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/sdk/tests/debug_mode_test.py +16 -16
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/setup.py +1 -1
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/README.md +0 -0
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/pyproject.toml +0 -0
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/python_sdk_local.egg-info/SOURCES.txt +0 -0
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/python_sdk_local.egg-info/dependency_links.txt +0 -0
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/python_sdk_local.egg-info/top_level.txt +0 -0
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/sdk/__init__.py +0 -0
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/sdk/src/__init__.py +0 -0
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/sdk/src/utilities.py +0 -0
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/sdk/tests/__init__.py +0 -0
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/sdk/tests/utilities_test.py +0 -0
- {python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/setup.cfg +0 -0
|
@@ -9,7 +9,7 @@ from logger_local.MessageSeverity import MessageSeverity
|
|
|
9
9
|
sys.path.append(os.getcwd())
|
|
10
10
|
from python_sdk_local.sdk.src.LoggerOutputEnum import LoggerOutputEnum
|
|
11
11
|
|
|
12
|
-
PYTHON_SDK_LOCAL_COMPONENT_ID =
|
|
12
|
+
PYTHON_SDK_LOCAL_COMPONENT_ID = 202
|
|
13
13
|
PYTHON_SDK_LOCAL_COMPONENT_NAME = 'python_sdk_local/src/debug_mode.py'
|
|
14
14
|
LOGGER_CONFIGURATION_JSON = '.logger.json'
|
|
15
15
|
LOGGER_MINIMUM_SEVERITY = os.getenv('LOGGER_MINIMUM_SEVERITY')
|
|
@@ -50,20 +50,21 @@ class DebugMode:
|
|
|
50
50
|
except FileNotFoundError:
|
|
51
51
|
self.debug_everything = True
|
|
52
52
|
logger.info("could not find .logger.json file, debugging everything")
|
|
53
|
-
except Exception as
|
|
54
|
-
logger.exception("encounteredthe following error", object={'exception':
|
|
55
|
-
finally:
|
|
53
|
+
except Exception as exception:
|
|
54
|
+
logger.exception("encounteredthe following error", object={'exception': exception})
|
|
56
55
|
logger.end(INIT_METHOD_NAME)
|
|
56
|
+
raise
|
|
57
|
+
logger.end(INIT_METHOD_NAME)
|
|
57
58
|
|
|
58
|
-
def
|
|
59
|
-
|
|
60
|
-
logger.start(
|
|
59
|
+
def is_logger_output(self, component_id:str, logger_output: LoggerOutputEnum, severity_level:int)->bool:
|
|
60
|
+
IS_LOGGER_OUTPUT_METHOD_NAME = "is_logger_output()"
|
|
61
|
+
logger.start(IS_LOGGER_OUTPUT_METHOD_NAME, object={'component_id': component_id, 'logger_output': str(logger_output), 'severity_level': severity_level})
|
|
61
62
|
|
|
62
63
|
|
|
63
64
|
#Debug everything that has a severity level higher than the minimum required
|
|
64
65
|
if self.debug_everything:
|
|
65
66
|
result = severity_level >= LOGGER_MINIMUM_SEVERITY
|
|
66
|
-
logger.end(
|
|
67
|
+
logger.end(IS_LOGGER_OUTPUT_METHOD_NAME, object={'result': result})
|
|
67
68
|
return result
|
|
68
69
|
|
|
69
70
|
severity_level = max(severity_level, LOGGER_MINIMUM_SEVERITY)
|
|
@@ -71,10 +72,11 @@ class DebugMode:
|
|
|
71
72
|
output_info = self.logger_json[component_id]
|
|
72
73
|
if logger_output in output_info:
|
|
73
74
|
result = severity_level >= output_info[logger_output]
|
|
74
|
-
logger.end(
|
|
75
|
+
logger.end(IS_LOGGER_OUTPUT_METHOD_NAME, object={'result': result})
|
|
75
76
|
return result
|
|
76
|
-
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
# In case the component do not exist in the logger configuration file or the
|
|
79
|
+
# logger_output was not specif
|
|
80
|
+
result = True
|
|
81
|
+
logger.end(IS_LOGGER_OUTPUT_METHOD_NAME, object={'result': result})
|
|
80
82
|
return result
|
|
@@ -67,10 +67,10 @@ def test_debug_mode_init():
|
|
|
67
67
|
assert result
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
def
|
|
70
|
+
def test_is_logger_output_debug_info_1():
|
|
71
71
|
|
|
72
|
-
|
|
73
|
-
logger.start(
|
|
72
|
+
TEST_is_logger_output_DEBUG_INFO_1_FUNCTION_NAME = 'test_is_logger_output_debug_info_1()'
|
|
73
|
+
logger.start(TEST_is_logger_output_DEBUG_INFO_1_FUNCTION_NAME)
|
|
74
74
|
|
|
75
75
|
add_debug_file(EXAMPLE_DATA_1)
|
|
76
76
|
|
|
@@ -78,17 +78,17 @@ def test_fetch_debug_info_1():
|
|
|
78
78
|
|
|
79
79
|
remove_debug_file()
|
|
80
80
|
|
|
81
|
-
result = debug.
|
|
82
|
-
logger.end(
|
|
81
|
+
result = debug.is_logger_output('1', LoggerOutputEnum.Console.value, 501) == True
|
|
82
|
+
logger.end(TEST_is_logger_output_DEBUG_INFO_1_FUNCTION_NAME,
|
|
83
83
|
object={'result': result})
|
|
84
84
|
|
|
85
85
|
assert result
|
|
86
86
|
|
|
87
87
|
|
|
88
|
-
def
|
|
88
|
+
def test_is_logger_output_debug_mode_2():
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
logger.start(
|
|
90
|
+
TEST_is_logger_output_DEBUG_MODE_2_FUNCTION_NAME = 'test_is_logger_output_debug_mode_2()'
|
|
91
|
+
logger.start(TEST_is_logger_output_DEBUG_MODE_2_FUNCTION_NAME)
|
|
92
92
|
|
|
93
93
|
add_debug_file(EXAMPLE_DATA_2)
|
|
94
94
|
|
|
@@ -96,12 +96,12 @@ def test_fetch_debug_mode_2():
|
|
|
96
96
|
|
|
97
97
|
remove_debug_file()
|
|
98
98
|
|
|
99
|
-
result1 = debug.
|
|
100
|
-
result2 = debug.
|
|
101
|
-
result3 = debug.
|
|
99
|
+
result1 = debug.is_logger_output('2', LoggerOutputEnum.Logzio.value, 502) == True
|
|
100
|
+
result2 = debug.is_logger_output('2', LoggerOutputEnum.MySQLDatabase.value, 503) == True
|
|
101
|
+
result3 = debug.is_logger_output('2', LoggerOutputEnum.Console.value, 499) == False
|
|
102
102
|
|
|
103
103
|
result = result1 and result2 and result3
|
|
104
|
-
logger.end(
|
|
104
|
+
logger.end(TEST_is_logger_output_DEBUG_MODE_2_FUNCTION_NAME,
|
|
105
105
|
object={'result': result})
|
|
106
106
|
assert result
|
|
107
107
|
|
|
@@ -117,8 +117,8 @@ def test_minimum_sevirity():
|
|
|
117
117
|
|
|
118
118
|
remove_debug_file()
|
|
119
119
|
|
|
120
|
-
result1 = debug.
|
|
121
|
-
result2 = debug.
|
|
120
|
+
result1 = debug.is_logger_output('2', LoggerOutputEnum.Logzio.value, 501) == False
|
|
121
|
+
result2 = debug.is_logger_output('2', LoggerOutputEnum.Logzio.value, 502) == True
|
|
122
122
|
|
|
123
123
|
debug_mode.LOGGER_MINIMUM_SEVERITY = 0
|
|
124
124
|
|
|
@@ -134,8 +134,8 @@ def test_debug_everything():
|
|
|
134
134
|
|
|
135
135
|
debug = debug_mode.DebugMode() # file DNE, so debug_everything = True
|
|
136
136
|
|
|
137
|
-
result1 = debug.
|
|
138
|
-
result2 = debug.
|
|
137
|
+
result1 = debug.is_logger_output('2', LoggerOutputEnum.Logzio.value, 501) == True
|
|
138
|
+
result2 = debug.is_logger_output('2', LoggerOutputEnum.Logzio.value, 502) == True
|
|
139
139
|
|
|
140
140
|
debug_mode.LOGGER_MINIMUM_SEVERITY = 0
|
|
141
141
|
|
|
@@ -3,7 +3,7 @@ import setuptools
|
|
|
3
3
|
# python -m build needs pyproject.toml or setup.py
|
|
4
4
|
setuptools.setup(
|
|
5
5
|
name='python-sdk-local',
|
|
6
|
-
version='0.0.
|
|
6
|
+
version='0.0.26', # https://pypi.org/project/python-sdk-local/
|
|
7
7
|
author="Circles",
|
|
8
8
|
author_email="info@circles.life",
|
|
9
9
|
description="PyPI Package for Circles Python SDK Local Python",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python-sdk-local-0.0.25 → python-sdk-local-0.0.26}/python_sdk_local.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|