LogFly 2.3__tar.gz → 2.4__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.
- {logfly-2.3/src/logfly.egg-info → logfly-2.4}/PKG-INFO +2 -2
- {logfly-2.3 → logfly-2.4}/README.md +1 -1
- {logfly-2.3 → logfly-2.4}/setup.py +1 -1
- {logfly-2.3 → logfly-2.4}/src/logfly/__init__.py +11 -7
- {logfly-2.3 → logfly-2.4/src/logfly.egg-info}/PKG-INFO +2 -2
- {logfly-2.3 → logfly-2.4}/LICENSE +0 -0
- {logfly-2.3 → logfly-2.4}/pyproject.toml +0 -0
- {logfly-2.3 → logfly-2.4}/setup.cfg +0 -0
- {logfly-2.3 → logfly-2.4}/src/logfly.egg-info/SOURCES.txt +0 -0
- {logfly-2.3 → logfly-2.4}/src/logfly.egg-info/dependency_links.txt +0 -0
- {logfly-2.3 → logfly-2.4}/src/logfly.egg-info/requires.txt +0 -0
- {logfly-2.3 → logfly-2.4}/src/logfly.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: logfly
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4
|
|
4
4
|
Summary: A simple log tool by python
|
|
5
5
|
Home-page: https://about.guki.me
|
|
6
6
|
Author: Yuan Sui
|
|
@@ -15,7 +15,7 @@ Requires-Python: >=3.6
|
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
17
|
|
|
18
|
-
# logfly 2.
|
|
18
|
+
# logfly 2.4
|
|
19
19
|
### a simple log tool by python.
|
|
20
20
|
|
|
21
21
|
## position
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#####################
|
|
2
2
|
# Author: Yuki Sui
|
|
3
|
-
# Date: 2022-
|
|
3
|
+
# Date: 2022-5-1
|
|
4
4
|
#####################
|
|
5
5
|
|
|
6
6
|
import time
|
|
@@ -10,16 +10,16 @@ from pathlib import Path
|
|
|
10
10
|
try:
|
|
11
11
|
from colorama import init
|
|
12
12
|
__colorama_init__ = True
|
|
13
|
-
except
|
|
13
|
+
except ModuleNotFoundError:
|
|
14
14
|
__colorama_init__ = False
|
|
15
15
|
pass
|
|
16
16
|
|
|
17
|
-
if __colorama_init__
|
|
17
|
+
if __colorama_init__:
|
|
18
18
|
init(autoreset=True)
|
|
19
19
|
else:
|
|
20
20
|
pass
|
|
21
21
|
|
|
22
|
-
__version__ = '2.
|
|
22
|
+
__version__ = '2.4'
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
def create_or_check_file(pathorfile, name, warning='yes'):
|
|
@@ -145,13 +145,15 @@ def write_log(name, position, level, message, mode='add',
|
|
|
145
145
|
elif color == 'yes':
|
|
146
146
|
LogFlyMessage = name + ' ' + get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + \
|
|
147
147
|
'\r\n '
|
|
148
|
-
if __colorama_init__
|
|
148
|
+
if __colorama_init__:
|
|
149
149
|
if str.upper(level) == 'INFO':
|
|
150
150
|
print(f'\033[0;34m{LogFlyMessage}\033[0m')
|
|
151
151
|
elif str.upper(level) == 'WARNING':
|
|
152
152
|
print(f'\033[0;33m{LogFlyMessage}\033[0m')
|
|
153
153
|
elif str.upper(level) == 'ERROR':
|
|
154
154
|
print(f'\033[0;31m{LogFlyMessage}\033[0m')
|
|
155
|
+
elif str.upper(level) == 'PASS':
|
|
156
|
+
print(f'\033[0;32m{LogFlyMessage}\033[0m')
|
|
155
157
|
else:
|
|
156
158
|
print(f'\033[0;37m{LogFlyMessage}\033[0m')
|
|
157
159
|
else:
|
|
@@ -195,13 +197,15 @@ def write_log(name, position, level, message, mode='add',
|
|
|
195
197
|
elif color == 'yes':
|
|
196
198
|
LogFlyMessage = name + ' ' + get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + \
|
|
197
199
|
'\r\n '
|
|
198
|
-
if __colorama_init__
|
|
200
|
+
if __colorama_init__:
|
|
199
201
|
if str.upper(level) == 'INFO':
|
|
200
202
|
print(f'\033[0;34m{LogFlyMessage}\033[0m')
|
|
201
203
|
elif str.upper(level) == 'WARNING':
|
|
202
204
|
print(f'\033[0;33m{LogFlyMessage}\033[0m')
|
|
203
205
|
elif str.upper(level) == 'ERROR':
|
|
204
206
|
print(f'\033[0;31m{LogFlyMessage}\033[0m')
|
|
207
|
+
elif str.upper(level) == 'PASS':
|
|
208
|
+
print(f'\033[0;32m{LogFlyMessage}\033[0m')
|
|
205
209
|
else:
|
|
206
210
|
print(f'\033[0;37m{LogFlyMessage}\033[0m')
|
|
207
211
|
else:
|
|
@@ -274,4 +278,4 @@ class ParameterERROR(Exception):
|
|
|
274
278
|
|
|
275
279
|
|
|
276
280
|
if __name__ == '__main__':
|
|
277
|
-
write_log('logfly-log', 'CLI', '
|
|
281
|
+
write_log('logfly-log', 'CLI', 'pass', 'test', hidden='yes')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: logfly
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4
|
|
4
4
|
Summary: A simple log tool by python
|
|
5
5
|
Home-page: https://about.guki.me
|
|
6
6
|
Author: Yuan Sui
|
|
@@ -15,7 +15,7 @@ Requires-Python: >=3.6
|
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
17
|
|
|
18
|
-
# logfly 2.
|
|
18
|
+
# logfly 2.4
|
|
19
19
|
### a simple log tool by python.
|
|
20
20
|
|
|
21
21
|
## position
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|