optimuslib 0.0.48__py3-none-any.whl → 0.0.49__py3-none-any.whl
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.
optimuslib/optimuslib.py
CHANGED
|
@@ -99,33 +99,27 @@
|
|
|
99
99
|
import logging
|
|
100
100
|
|
|
101
101
|
# Creating logger
|
|
102
|
-
# logging.basicConfig(level=logging.DEBUG)
|
|
103
|
-
# logging.basicConfig(level=logging.DEBUG, filename='logs.txt', format='%(asctime)s - %(levelname)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
|
|
104
|
-
# logging.basicConfig(level=logging.DEBUG, filename='logs.txt', format='%(asctime)s — %(name)s — %(levelname)s — %(funcName)s:%(lineno)d — %(message)s', datefmt='%d-%b-%y %H:%M:%S')
|
|
105
102
|
log = logging.getLogger(__name__)
|
|
106
103
|
log.setLevel(logging.DEBUG)
|
|
107
|
-
# log.setLevel(logging.INFO)
|
|
108
104
|
|
|
109
|
-
#
|
|
105
|
+
# Handler - 1: File Handler
|
|
110
106
|
file = logging.FileHandler('optimuslibLogs.log', 'a', 'utf-8')
|
|
111
|
-
# fileformat = logging.Formatter(fmt='%(asctime)s - %(levelname)s - %(filename)s - %(module)s:%(funcName)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
|
|
112
107
|
fileformat = logging.Formatter(fmt='%(asctime)s | %(levelname)s | %(filename)s | %(funcName)s | %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
|
|
113
108
|
file.setLevel(logging.DEBUG)
|
|
114
|
-
# file.setLevel(logging.INFO)
|
|
115
109
|
file.setFormatter(fileformat)
|
|
116
110
|
|
|
117
|
-
#
|
|
111
|
+
# Handler - 2: Stream Handler
|
|
118
112
|
stream = logging.StreamHandler()
|
|
119
|
-
# streamformat = logging.Formatter(fmt='%(asctime)s - %(levelname)s - %(message)s', datefmt='%Y-%m-%d %H:%M:%S')
|
|
120
|
-
streamformat = fileformat
|
|
121
113
|
stream.setLevel(logging.DEBUG)
|
|
122
|
-
|
|
123
|
-
stream.setFormatter(streamformat)
|
|
114
|
+
stream.setFormatter(fileformat)
|
|
124
115
|
|
|
125
|
-
#
|
|
116
|
+
# Adding handlers to the logger (not to root logger to avoid duplicates)
|
|
126
117
|
log.addHandler(file)
|
|
127
118
|
log.addHandler(stream)
|
|
128
119
|
|
|
120
|
+
# Prevent propagation to root logger to avoid duplicate logs
|
|
121
|
+
log.propagate = False
|
|
122
|
+
|
|
129
123
|
def loglib(data):
|
|
130
124
|
log.info(data)
|
|
131
125
|
log.info('%d %s','1', 'a')
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
optimuslib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
+
optimuslib/optimuslib.py,sha256=nZPdZXFPB0uOWqp3xMx5e9d5Yrd3qdRkFWOm7WqCufo,65665
|
|
3
|
+
optimuslib-0.0.49.dist-info/METADATA,sha256=1T3JxGmn2y7HlZVlvhP4IWzOb9g9hZJEbRRWW0iSMd4,723
|
|
4
|
+
optimuslib-0.0.49.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
|
|
5
|
+
optimuslib-0.0.49.dist-info/RECORD,,
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
optimuslib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
optimuslib/optimuslib.py,sha256=xsoQQgTyA5UhIfLS3mEyLKR4jzbhLriT-E-3yk7FcXg,66286
|
|
3
|
-
optimuslib-0.0.48.dist-info/METADATA,sha256=1VrHrlb6_vwzIFBuNiEXSIu1_isvo6Or6tzhtrtt_5A,723
|
|
4
|
-
optimuslib-0.0.48.dist-info/WHEEL,sha256=3ny-bZhpXrU6vSQ1UPG34FoxZBp3lVcvK0LkgUz6VLk,88
|
|
5
|
-
optimuslib-0.0.48.dist-info/RECORD,,
|
|
File without changes
|