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 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='info',
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 == 'info'
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()) == 6
238
- assert len(_logger_file()) == 6
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()) == 6
246
- assert len(_logger_file()) == 6
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()) == 7
265
- assert len(_logger_file()) == 7
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()) == 7
274
- assert len(_logger_file()) == 7
288
+ assert len(_logger_stdo()) == 6
289
+ assert len(_logger_file()) == 6
encommon/conftest.py CHANGED
@@ -36,7 +36,7 @@ def config_factory(
36
36
  - '{SAMPLES}/wayne'
37
37
 
38
38
  enlogger:
39
- stdo_level: info
39
+ stdo_level: debug
40
40
 
41
41
  encrypts:
42
42
  phrases:
encommon/version.txt CHANGED
@@ -1 +1 @@
1
- 0.17.0
1
+ 0.17.1
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: encommon
3
- Version: 0.17.0
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=pDU0t5M2fMKPFZsbxJ1ty_dxW_BoiyEC7VoNSqNBVHc,1899
2
+ encommon/conftest.py,sha256=qorgldYdoDt_LFQupdT0ZUF5eAVPuJ5X3Jvv4VIa78Q,1900
3
3
  encommon/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- encommon/version.txt,sha256=AtOOmOiPSo3C6kDbt2kzhgEGb8lJILUogqFPIa2X9-4,7
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=1eAcJ2reIhk1SVhhcfPNiUGtRPj0N3h1e_YHX7w_IKg,14332
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=jj-vX9v4cl0nAqb3lgDoDeDCQMzP63Ip-ek1eIh5bmc,5293
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.0.dist-info/LICENSE,sha256=otnXKCtMjPlbHs0wgZ_BWULrp3g_2dWQJ6icRk9nkgg,1071
81
- encommon-0.17.0.dist-info/METADATA,sha256=ieo8193Z8YtT8np40oSLNq-qST2PJzp5QMtxozJ9CIY,3362
82
- encommon-0.17.0.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
83
- encommon-0.17.0.dist-info/top_level.txt,sha256=bP8q7-5tLDNm-3XPlqn_bDENfYNug5801H_xfz3BEAM,9
84
- encommon-0.17.0.dist-info/RECORD,,
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,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (74.1.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5