python-printr 3.9__tar.gz → 4.1__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-printr-3.9/python_printr.egg-info → python-printr-4.1}/PKG-INFO +1 -1
- {python-printr-3.9 → python-printr-4.1}/printr/__init__.py +6 -4
- {python-printr-3.9 → python-printr-4.1/python_printr.egg-info}/PKG-INFO +1 -1
- {python-printr-3.9 → python-printr-4.1}/setup.py +1 -1
- {python-printr-3.9 → python-printr-4.1}/.gitignore +0 -0
- {python-printr-3.9 → python-printr-4.1}/README.md +0 -0
- {python-printr-3.9 → python-printr-4.1}/python_printr.egg-info/SOURCES.txt +0 -0
- {python-printr-3.9 → python-printr-4.1}/python_printr.egg-info/dependency_links.txt +0 -0
- {python-printr-3.9 → python-printr-4.1}/python_printr.egg-info/requires.txt +0 -0
- {python-printr-3.9 → python-printr-4.1}/python_printr.egg-info/top_level.txt +0 -0
- {python-printr-3.9 → python-printr-4.1}/setup.cfg +0 -0
|
@@ -3,7 +3,7 @@ from time import sleep
|
|
|
3
3
|
from pathlib import Path
|
|
4
4
|
from datetime import datetime
|
|
5
5
|
|
|
6
|
-
class
|
|
6
|
+
class Logger:
|
|
7
7
|
def __init__(self, log_filepath=None, max_lines=100_000, level='info', name=None, log_to_file=True):
|
|
8
8
|
filename = Path(sys.argv[0]).stem
|
|
9
9
|
self.filename = filename
|
|
@@ -73,8 +73,8 @@ class logger:
|
|
|
73
73
|
if number_of_lines > self.max_lines:
|
|
74
74
|
self.logger.info('Resetting log file')
|
|
75
75
|
self.log_file.close()
|
|
76
|
-
sleep(
|
|
77
|
-
os.replace(self.log_filepath, self.backup_log_filepath)
|
|
76
|
+
# sleep(10)
|
|
77
|
+
# os.replace(self.log_filepath, self.backup_log_filepath)
|
|
78
78
|
log_file = logging.FileHandler(self.log_filepath, mode='w', encoding='utf-8')
|
|
79
79
|
log_format = logging.Formatter(fmt=self.indent + '%(levelname)s - %(asctime)s.%(msecs)03d - Line %(lineno)s: %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
|
|
80
80
|
log_file.setFormatter(log_format)
|
|
@@ -180,4 +180,6 @@ def prettify(items, beautify):
|
|
|
180
180
|
except TypeError:
|
|
181
181
|
pass
|
|
182
182
|
message += str(item)
|
|
183
|
-
return message
|
|
183
|
+
return message
|
|
184
|
+
|
|
185
|
+
logger = Logger
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|