encommon 0.17.0__py3-none-any.whl → 0.17.1__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- encommon/config/logger.py +8 -1
- encommon/config/test/test_logger.py +25 -10
- encommon/conftest.py +1 -1
- encommon/version.txt +1 -1
- {encommon-0.17.0.dist-info → encommon-0.17.1.dist-info}/METADATA +2 -2
- {encommon-0.17.0.dist-info → encommon-0.17.1.dist-info}/RECORD +9 -9
- {encommon-0.17.0.dist-info → encommon-0.17.1.dist-info}/WHEEL +1 -1
- {encommon-0.17.0.dist-info → encommon-0.17.1.dist-info}/LICENSE +0 -0
- {encommon-0.17.0.dist-info → encommon-0.17.1.dist-info}/top_level.txt +0 -0
encommon/config/logger.py
CHANGED
@@ -133,7 +133,7 @@ class Message:
|
|
133
133
|
value = round(value, 2)
|
134
134
|
|
135
135
|
|
136
|
-
value = str(value)
|
136
|
+
value = str(value).strip()
|
137
137
|
|
138
138
|
self.__fields[key] = value
|
139
139
|
|
@@ -574,6 +574,13 @@ class Logger:
|
|
574
574
|
logr_stdo = self.__logr_stdo
|
575
575
|
logr_file = self.__logr_file
|
576
576
|
|
577
|
+
# Prevent debug from creating
|
578
|
+
# new object each time called
|
579
|
+
if (level == 'debug'
|
580
|
+
and stdo_level != 'debug'
|
581
|
+
and file_level != 'debug'):
|
582
|
+
return None
|
583
|
+
|
577
584
|
message = Message(level, **kwargs)
|
578
585
|
|
579
586
|
if stdo_level is not None:
|
@@ -42,7 +42,7 @@ def logger(
|
|
42
42
|
"""
|
43
43
|
|
44
44
|
params = LoggerParams(
|
45
|
-
stdo_level='
|
45
|
+
stdo_level='debug',
|
46
46
|
file_level='info',
|
47
47
|
file_path=f'{tmp_path}/test.log')
|
48
48
|
|
@@ -166,7 +166,7 @@ def test_Logger(
|
|
166
166
|
|
167
167
|
assert logger.params
|
168
168
|
|
169
|
-
assert logger.stdo_level == '
|
169
|
+
assert logger.stdo_level == 'debug'
|
170
170
|
|
171
171
|
assert logger.file_level == 'info'
|
172
172
|
|
@@ -201,6 +201,21 @@ def test_Logger_cover(
|
|
201
201
|
time = Time('now')
|
202
202
|
|
203
203
|
|
204
|
+
# Test preventing debug from
|
205
|
+
# any needless instantiation
|
206
|
+
setattr(
|
207
|
+
logger,
|
208
|
+
'_Logger__file_level',
|
209
|
+
'info')
|
210
|
+
|
211
|
+
# Test preventing debug from
|
212
|
+
# any needless instantiation
|
213
|
+
setattr(
|
214
|
+
logger,
|
215
|
+
'_Logger__stdo_level',
|
216
|
+
'info')
|
217
|
+
|
218
|
+
|
204
219
|
def _logger_logs() -> None:
|
205
220
|
logger.log_d(msg='pytest')
|
206
221
|
logger.log_c(msg='pytest')
|
@@ -234,16 +249,16 @@ def test_Logger_cover(
|
|
234
249
|
|
235
250
|
_logger_logs()
|
236
251
|
|
237
|
-
assert len(_logger_stdo()) ==
|
238
|
-
assert len(_logger_file()) ==
|
252
|
+
assert len(_logger_stdo()) == 5
|
253
|
+
assert len(_logger_file()) == 5
|
239
254
|
|
240
255
|
logger.stop()
|
241
256
|
|
242
257
|
|
243
258
|
_logger_logs()
|
244
259
|
|
245
|
-
assert len(_logger_stdo()) ==
|
246
|
-
assert len(_logger_file()) ==
|
260
|
+
assert len(_logger_stdo()) == 5
|
261
|
+
assert len(_logger_file()) == 5
|
247
262
|
|
248
263
|
|
249
264
|
logger.start()
|
@@ -261,8 +276,8 @@ def test_Logger_cover(
|
|
261
276
|
assert message in str(stdo)
|
262
277
|
assert message in str(file)
|
263
278
|
|
264
|
-
assert len(_logger_stdo()) ==
|
265
|
-
assert len(_logger_file()) ==
|
279
|
+
assert len(_logger_stdo()) == 6
|
280
|
+
assert len(_logger_file()) == 6
|
266
281
|
|
267
282
|
|
268
283
|
logger.stop()
|
@@ -270,5 +285,5 @@ def test_Logger_cover(
|
|
270
285
|
|
271
286
|
_logger_logs()
|
272
287
|
|
273
|
-
assert len(_logger_stdo()) ==
|
274
|
-
assert len(_logger_file()) ==
|
288
|
+
assert len(_logger_stdo()) == 6
|
289
|
+
assert len(_logger_file()) == 6
|
encommon/conftest.py
CHANGED
encommon/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.17.
|
1
|
+
0.17.1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: encommon
|
3
|
-
Version: 0.17.
|
3
|
+
Version: 0.17.1
|
4
4
|
Summary: Enasis Network Common Library
|
5
5
|
License: MIT
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
@@ -88,7 +88,7 @@ make -s pytest
|
|
88
88
|
|
89
89
|
1. Create [repository](https://github.com/enasisnetwork/encommon) release.
|
90
90
|
|
91
|
-
1. Build the Python package.<br>
|
91
|
+
1. Build the Python package.<br>Be sure no uncommited files in tree.
|
92
92
|
```
|
93
93
|
make -s pypackage
|
94
94
|
```
|
@@ -1,7 +1,7 @@
|
|
1
1
|
encommon/__init__.py,sha256=YDGzuhpk5Gd1hq54LI0hw1NrrDvrJDrvH20TEy_0l5E,443
|
2
|
-
encommon/conftest.py,sha256=
|
2
|
+
encommon/conftest.py,sha256=qorgldYdoDt_LFQupdT0ZUF5eAVPuJ5X3Jvv4VIa78Q,1900
|
3
3
|
encommon/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
encommon/version.txt,sha256=
|
4
|
+
encommon/version.txt,sha256=zYHsGXZ_-4B7rabUhXihjXeimts5TgnpzfzV6p7rtqI,7
|
5
5
|
encommon/colors/__init__.py,sha256=XRiGimMj8oo040NO5a5ZsbsIUxaGVW4tf4xWTPWgnZY,269
|
6
6
|
encommon/colors/color.py,sha256=EiUxNbVL1689Cqhw1LmO9ysmN3ulCVtGZGylyV8LuVA,10884
|
7
7
|
encommon/colors/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
@@ -9,14 +9,14 @@ encommon/colors/test/test_color.py,sha256=GKYzfnOlb2yKI0qmPDxumkeQNSXpvxTprUV9pA
|
|
9
9
|
encommon/config/__init__.py,sha256=iZdbW7A4m7iN4xt5cEeQqo0Klqs-CaPLdD5ocLmUYi8,856
|
10
10
|
encommon/config/config.py,sha256=-votrrG3pvU3oWrHoIMKu-pPZSC2MpdGz-1RSK6uXtk,6953
|
11
11
|
encommon/config/files.py,sha256=dSuShvIbQXFiNmpkwNVHCKDI-phBWC03OJVUfKJnfX0,2433
|
12
|
-
encommon/config/logger.py,sha256=
|
12
|
+
encommon/config/logger.py,sha256=MsGng6k1m4r5DnFkX8PhO33nj26AyiRYrKtFkjhAuNo,14556
|
13
13
|
encommon/config/params.py,sha256=FtcWi3-CY6OHLN7o3S-iBktpS1yGt5wLVD0546XEKRY,2223
|
14
14
|
encommon/config/paths.py,sha256=6eLhqEXDyNQpwdL6QWNPf060uayuUzXyM6A3ikNC24Q,2585
|
15
15
|
encommon/config/utils.py,sha256=jZ9x6Nd7H4XZMSyAFr7mydgIu8P7xBzjHqKzMpmduw0,2127
|
16
16
|
encommon/config/test/__init__.py,sha256=Vs5Pca7QBgoyoSjk6DSpO0YFcqkUhap5-VLbaCn8MjA,304
|
17
17
|
encommon/config/test/test_config.py,sha256=uhvkgdW_vRX4MeKlRb4u0lJnpF4sqrgKxUXU97i2LA0,2965
|
18
18
|
encommon/config/test/test_files.py,sha256=elw484lZ9pF9fhBhRWQ_xCVjFhQXd0E5BMNaB3cbMAs,2301
|
19
|
-
encommon/config/test/test_logger.py,sha256=
|
19
|
+
encommon/config/test/test_logger.py,sha256=NrPLBCQB4m0bCoeYoEwMr0uxckeHBsy1T0C_noIs65A,5582
|
20
20
|
encommon/config/test/test_paths.py,sha256=f3slZZkJqnFJK4DAFbQSdnUymhap1GXc9eZmS--vNT4,2649
|
21
21
|
encommon/config/test/test_utils.py,sha256=RePpMD97HRCTkZ75ES8Eaf6_BOpcw_DknpgCFZGlQYg,1066
|
22
22
|
encommon/crypts/__init__.py,sha256=UsGEitz8rWa7DQF3iAxEbTUAbdiEnE87LSuRs4OBeAQ,371
|
@@ -77,8 +77,8 @@ encommon/utils/test/test_match.py,sha256=QagKpTFdRo23-Y55fSaJrSMpt5jIebScKbz0h8t
|
|
77
77
|
encommon/utils/test/test_paths.py,sha256=4AzIhQyYFEWhRWHgOZCCzomQ3Zs3EVwRnDQDa6Nq1Mc,1942
|
78
78
|
encommon/utils/test/test_sample.py,sha256=Qf-W0XbjTe5PfG87sdVizL2ymUPRTdX0qQtLGHaTgx8,3539
|
79
79
|
encommon/utils/test/test_stdout.py,sha256=fYiqEaUraD-3hFQYLxMPR4Ti_8CbTjEc8WvReXUA884,6139
|
80
|
-
encommon-0.17.
|
81
|
-
encommon-0.17.
|
82
|
-
encommon-0.17.
|
83
|
-
encommon-0.17.
|
84
|
-
encommon-0.17.
|
80
|
+
encommon-0.17.1.dist-info/LICENSE,sha256=otnXKCtMjPlbHs0wgZ_BWULrp3g_2dWQJ6icRk9nkgg,1071
|
81
|
+
encommon-0.17.1.dist-info/METADATA,sha256=dtovts-LKqIe52LOdUDXaN80mnW_qAkBaztH6EmwCjQ,3398
|
82
|
+
encommon-0.17.1.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
83
|
+
encommon-0.17.1.dist-info/top_level.txt,sha256=bP8q7-5tLDNm-3XPlqn_bDENfYNug5801H_xfz3BEAM,9
|
84
|
+
encommon-0.17.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|