LogFly 2.2__tar.gz → 2.3__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.2/src/logfly.egg-info → logfly-2.3}/PKG-INFO +2 -2
- {logfly-2.2 → logfly-2.3}/README.md +1 -1
- {logfly-2.2 → logfly-2.3}/setup.py +1 -1
- {logfly-2.2 → logfly-2.3}/src/logfly/__init__.py +34 -19
- {logfly-2.2 → logfly-2.3/src/logfly.egg-info}/PKG-INFO +2 -2
- {logfly-2.2 → logfly-2.3}/LICENSE +0 -0
- {logfly-2.2 → logfly-2.3}/pyproject.toml +0 -0
- {logfly-2.2 → logfly-2.3}/setup.cfg +0 -0
- {logfly-2.2 → logfly-2.3}/src/logfly.egg-info/SOURCES.txt +0 -0
- {logfly-2.2 → logfly-2.3}/src/logfly.egg-info/dependency_links.txt +0 -0
- {logfly-2.2 → logfly-2.3}/src/logfly.egg-info/requires.txt +0 -0
- {logfly-2.2 → logfly-2.3}/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.3
|
|
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.3
|
|
19
19
|
### a simple log tool by python.
|
|
20
20
|
|
|
21
21
|
## position
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
#####################
|
|
2
2
|
# Author: Yuki Sui
|
|
3
|
-
# Date: 2022-
|
|
3
|
+
# Date: 2022-4-1
|
|
4
4
|
#####################
|
|
5
5
|
|
|
6
6
|
import time
|
|
7
7
|
import shutil
|
|
8
8
|
import os
|
|
9
9
|
from pathlib import Path
|
|
10
|
-
|
|
10
|
+
try:
|
|
11
|
+
from colorama import init
|
|
12
|
+
__colorama_init__ = True
|
|
13
|
+
except Exception:
|
|
14
|
+
__colorama_init__ = False
|
|
15
|
+
pass
|
|
11
16
|
|
|
12
|
-
|
|
13
|
-
|
|
17
|
+
if __colorama_init__ == True:
|
|
18
|
+
init(autoreset=True)
|
|
19
|
+
else:
|
|
20
|
+
pass
|
|
21
|
+
|
|
22
|
+
__version__ = '2.3'
|
|
14
23
|
|
|
15
24
|
|
|
16
25
|
def create_or_check_file(pathorfile, name, warning='yes'):
|
|
@@ -136,14 +145,17 @@ def write_log(name, position, level, message, mode='add',
|
|
|
136
145
|
elif color == 'yes':
|
|
137
146
|
LogFlyMessage = name + ' ' + get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + \
|
|
138
147
|
'\r\n '
|
|
139
|
-
if
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
148
|
+
if __colorama_init__ == True:
|
|
149
|
+
if str.upper(level) == 'INFO':
|
|
150
|
+
print(f'\033[0;34m{LogFlyMessage}\033[0m')
|
|
151
|
+
elif str.upper(level) == 'WARNING':
|
|
152
|
+
print(f'\033[0;33m{LogFlyMessage}\033[0m')
|
|
153
|
+
elif str.upper(level) == 'ERROR':
|
|
154
|
+
print(f'\033[0;31m{LogFlyMessage}\033[0m')
|
|
155
|
+
else:
|
|
156
|
+
print(f'\033[0;37m{LogFlyMessage}\033[0m')
|
|
145
157
|
else:
|
|
146
|
-
print(
|
|
158
|
+
print(LogFlyMessage)
|
|
147
159
|
else:
|
|
148
160
|
mesg = str(message) + '\r\n\r\n'
|
|
149
161
|
print(mesg)
|
|
@@ -183,14 +195,17 @@ def write_log(name, position, level, message, mode='add',
|
|
|
183
195
|
elif color == 'yes':
|
|
184
196
|
LogFlyMessage = name + ' ' + get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + \
|
|
185
197
|
'\r\n '
|
|
186
|
-
if
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
198
|
+
if __colorama_init__ == True:
|
|
199
|
+
if str.upper(level) == 'INFO':
|
|
200
|
+
print(f'\033[0;34m{LogFlyMessage}\033[0m')
|
|
201
|
+
elif str.upper(level) == 'WARNING':
|
|
202
|
+
print(f'\033[0;33m{LogFlyMessage}\033[0m')
|
|
203
|
+
elif str.upper(level) == 'ERROR':
|
|
204
|
+
print(f'\033[0;31m{LogFlyMessage}\033[0m')
|
|
205
|
+
else:
|
|
206
|
+
print(f'\033[0;37m{LogFlyMessage}\033[0m')
|
|
192
207
|
else:
|
|
193
|
-
print(
|
|
208
|
+
print(LogFlyMessage)
|
|
194
209
|
else:
|
|
195
210
|
mesg = str(message) + '\r\n\r\n'
|
|
196
211
|
print(mesg)
|
|
@@ -259,4 +274,4 @@ class ParameterERROR(Exception):
|
|
|
259
274
|
|
|
260
275
|
|
|
261
276
|
if __name__ == '__main__':
|
|
262
|
-
write_log('logfly-log', '
|
|
277
|
+
write_log('logfly-log', 'CLI', 'error', 'test', hidden='yes')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: logfly
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.3
|
|
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.3
|
|
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
|