ParUtils 1.2.1__py3-none-any.whl → 1.2.2__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- {ParUtils-1.2.1.dist-info → ParUtils-1.2.2.dist-info}/METADATA +1 -1
- {ParUtils-1.2.1.dist-info → ParUtils-1.2.2.dist-info}/RECORD +7 -7
- parutils/changelog.py +6 -3
- parutils/logging/logger.py +28 -3
- {ParUtils-1.2.1.dist-info → ParUtils-1.2.2.dist-info}/LICENSE +0 -0
- {ParUtils-1.2.1.dist-info → ParUtils-1.2.2.dist-info}/WHEEL +0 -0
- {ParUtils-1.2.1.dist-info → ParUtils-1.2.2.dist-info}/top_level.txt +0 -0
@@ -1,5 +1,5 @@
|
|
1
1
|
parutils/__init__.py,sha256=EaFtUmU0kYgnjvAFwPmoKt7I5zn9bxY02R7TUtcE6M4,1434
|
2
|
-
parutils/changelog.py,sha256=
|
2
|
+
parutils/changelog.py,sha256=FRy4UkSbAPMgv4bnES4tYjs8_j-u8pl9Kq26keg0ygs,1591
|
3
3
|
parutils/csvl.py,sha256=UBqw0lyhTNqFLSNIE-JM7TAQYCRgHftYQmHi21ru8-A,2874
|
4
4
|
parutils/dq.py,sha256=kdvzOo5FLCumXagY05kGSseYlbR-zvjjmsMtGVliVc8,2302
|
5
5
|
parutils/file.py,sha256=-OPfMhTjHDqubZLWJquY-FOv3W_k9GWoMq_rNgtdU9Y,2881
|
@@ -13,11 +13,11 @@ parutils/logging/cl.py,sha256=NCLuxLHvqRTypZlAgwnegkByLTnTirKntnwguJHBelA,2086
|
|
13
13
|
parutils/logging/const.py,sha256=L2OppBDAZYKUTIjsLPt6hTUh8UWH_1mX9YaGWlwzpj4,135
|
14
14
|
parutils/logging/core.py,sha256=vBwZnpM2GRNSSABPdzEM9SRpqr_YNqdPlG3T3lNPSiY,843
|
15
15
|
parutils/logging/g.py,sha256=ZSrgZw63kwxIW66A7-9_iYeDt4AstNZ_XXQgK8MglyQ,47
|
16
|
-
parutils/logging/logger.py,sha256=
|
16
|
+
parutils/logging/logger.py,sha256=Blt-loNbEyVo83E4viX1kDeY__6_bbwzWlIyDNPFLHU,4689
|
17
17
|
parutils/logging/main.py,sha256=arUvgB0YTZpidt4wl2GZsR4bRUj_rrSYMrTnCMKt4gA,2127
|
18
18
|
parutils/logging/sl.py,sha256=3-sj_o33cZmOqeFxlTl5HyHOvSAhn9glYcc-BmTUpZc,1164
|
19
|
-
ParUtils-1.2.
|
20
|
-
ParUtils-1.2.
|
21
|
-
ParUtils-1.2.
|
22
|
-
ParUtils-1.2.
|
23
|
-
ParUtils-1.2.
|
19
|
+
ParUtils-1.2.2.dist-info/LICENSE,sha256=6kbiFSfobTZ7beWiKnHpN902HgBx-Jzgcme0SvKqhKY,1091
|
20
|
+
ParUtils-1.2.2.dist-info/METADATA,sha256=s80O3PPMMmB_xSHMq4hhmYnPqqwYylAqrzbcCZLpnUs,5285
|
21
|
+
ParUtils-1.2.2.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
22
|
+
ParUtils-1.2.2.dist-info/top_level.txt,sha256=1MDobUcroeYEvdupZCAFvA5hJjm7LSDUV5A4jHySNis,9
|
23
|
+
ParUtils-1.2.2.dist-info/RECORD,,
|
parutils/changelog.py
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
__VERSION__ = '1.2.
|
2
|
-
#
|
3
|
-
|
1
|
+
__VERSION__ = '1.2.2'
|
2
|
+
# log_every
|
3
|
+
|
4
|
+
# __VERSION__ = '1.2.1'
|
5
|
+
# # log_dict + log_array - only one log_print -> better perfs
|
6
|
+
# # Improved check_log logs - name appears when nok
|
4
7
|
|
5
8
|
# __VERSION__ = '1.2.0'
|
6
9
|
# # logging - error handling
|
parutils/logging/logger.py
CHANGED
@@ -21,6 +21,7 @@ class Logger:
|
|
21
21
|
file_write=True,
|
22
22
|
dir=None,
|
23
23
|
file_format=None,
|
24
|
+
log_every=1,
|
24
25
|
) -> None:
|
25
26
|
from . import g
|
26
27
|
|
@@ -35,9 +36,13 @@ class Logger:
|
|
35
36
|
self.log_format = log_format if log_format else const.DEFAULT_LOG_FORMAT
|
36
37
|
self.file_write = file_write
|
37
38
|
self.start_time = time()
|
39
|
+
|
40
|
+
self.log_every = log_every
|
41
|
+
self.log_every_counter = 0
|
42
|
+
self.log_every_buffer = ''
|
43
|
+
|
38
44
|
if not file_write:
|
39
45
|
return
|
40
|
-
|
41
46
|
self.file_label = file_label
|
42
47
|
self.dir = dir if dir else const.DEFAULT_DIR
|
43
48
|
self.file_format = file_format if file_format else const.DEFAULT_FILE_FORMAT
|
@@ -57,9 +62,13 @@ class Logger:
|
|
57
62
|
self.log_print(s)
|
58
63
|
g.logger = self
|
59
64
|
|
60
|
-
|
61
|
-
def close():
|
65
|
+
def close(self):
|
62
66
|
from . import g
|
67
|
+
if self.log_every_buffer:
|
68
|
+
self.log_every = 1
|
69
|
+
self.log_every_counter = 0
|
70
|
+
self._write_log(self.log_every_buffer, c_out=False)
|
71
|
+
self.log_every_buffer = ''
|
63
72
|
g.logger = None
|
64
73
|
|
65
74
|
def log(self, *args, level=0, c_out=True):
|
@@ -87,6 +96,22 @@ class Logger:
|
|
87
96
|
|
88
97
|
if str_out:
|
89
98
|
return s + '\n'
|
99
|
+
|
100
|
+
if self.log_every > 1:
|
101
|
+
self.log_every_counter += 1
|
102
|
+
if self.log_every_counter % self.log_every == 0:
|
103
|
+
self._write_log(self.log_every_buffer + s, c_out=False)
|
104
|
+
if c_out:
|
105
|
+
print(s)
|
106
|
+
self.log_every_buffer = ''
|
107
|
+
self.log_every_counter = 0
|
108
|
+
return
|
109
|
+
else:
|
110
|
+
self.log_every_buffer += s + '\n'
|
111
|
+
if c_out:
|
112
|
+
print(s)
|
113
|
+
return
|
114
|
+
|
90
115
|
with lock:
|
91
116
|
self._write_log(s, c_out)
|
92
117
|
|
File without changes
|
File without changes
|
File without changes
|