LogFly 2.1__tar.gz → 2.2__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.1/src/logfly.egg-info → logfly-2.2}/PKG-INFO +2 -2
- {logfly-2.1 → logfly-2.2}/README.md +1 -1
- {logfly-2.1 → logfly-2.2}/setup.py +1 -1
- {logfly-2.1 → logfly-2.2}/src/logfly/__init__.py +22 -2
- {logfly-2.1 → logfly-2.2/src/logfly.egg-info}/PKG-INFO +2 -2
- {logfly-2.1 → logfly-2.2}/LICENSE +0 -0
- {logfly-2.1 → logfly-2.2}/pyproject.toml +0 -0
- {logfly-2.1 → logfly-2.2}/setup.cfg +0 -0
- {logfly-2.1 → logfly-2.2}/src/logfly.egg-info/SOURCES.txt +0 -0
- {logfly-2.1 → logfly-2.2}/src/logfly.egg-info/dependency_links.txt +0 -0
- {logfly-2.1 → logfly-2.2}/src/logfly.egg-info/requires.txt +0 -0
- {logfly-2.1 → logfly-2.2}/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.2
|
|
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.2
|
|
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-
|
|
3
|
+
# Date: 2022-3-16
|
|
4
4
|
#####################
|
|
5
5
|
|
|
6
6
|
import time
|
|
@@ -10,7 +10,7 @@ from pathlib import Path
|
|
|
10
10
|
from colorama import init
|
|
11
11
|
|
|
12
12
|
init(autoreset=True)
|
|
13
|
-
__version__ = '2.
|
|
13
|
+
__version__ = '2.2'
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
def create_or_check_file(pathorfile, name, warning='yes'):
|
|
@@ -107,6 +107,8 @@ def write_log(name, position, level, message, mode='add',
|
|
|
107
107
|
elif str_message == 'no':
|
|
108
108
|
pass
|
|
109
109
|
else:
|
|
110
|
+
mesg = str(message) + '\r\n\r\n'
|
|
111
|
+
print(mesg)
|
|
110
112
|
raise ParameterERROR('function write_log Parameter error! str_message must be "yes" or "no"! ')
|
|
111
113
|
if hidden == "no":
|
|
112
114
|
logfolder = '.\\logs\\' + folder_name + '\\' + get_time('date') + '\\'
|
|
@@ -115,6 +117,8 @@ def write_log(name, position, level, message, mode='add',
|
|
|
115
117
|
logfolder_hidden = str(Path.home()) + '\\.1o9f1y\\' + folder_name + '\\' + get_time('date') + '\\'
|
|
116
118
|
create_log_folder(folder_name, hidden)
|
|
117
119
|
else:
|
|
120
|
+
mesg = str(message) + '\r\n\r\n'
|
|
121
|
+
print(mesg)
|
|
118
122
|
raise ParameterERROR('function write_log Parameter error! hidden must be "no" or "yes"! ')
|
|
119
123
|
if mode == 'add':
|
|
120
124
|
LOGFILE_hidden = name + '-' + get_time('date') + '.log'
|
|
@@ -123,6 +127,8 @@ def write_log(name, position, level, message, mode='add',
|
|
|
123
127
|
LOGFILE_hidden = name + '-' + get_time('datetimefile') + '.log'
|
|
124
128
|
LOGFILE = logfolder + name + '-' + get_time('datetimefile') + '.log'
|
|
125
129
|
else:
|
|
130
|
+
mesg = str(message) + '\r\n\r\n'
|
|
131
|
+
print(mesg)
|
|
126
132
|
raise ParameterERROR('function write_log Parameter error! mode must be "add" or "new"! ')
|
|
127
133
|
if position == 'CLI':
|
|
128
134
|
if color == 'no':
|
|
@@ -139,6 +145,8 @@ def write_log(name, position, level, message, mode='add',
|
|
|
139
145
|
else:
|
|
140
146
|
print(f'\033[0;37m{LogFlyMessage}\033[0m')
|
|
141
147
|
else:
|
|
148
|
+
mesg = str(message) + '\r\n\r\n'
|
|
149
|
+
print(mesg)
|
|
142
150
|
raise ParameterERROR('function write_log Parameter error! color must be "yes" or "no"! ')
|
|
143
151
|
elif position == 'file':
|
|
144
152
|
if mode == 'add':
|
|
@@ -151,6 +159,8 @@ def write_log(name, position, level, message, mode='add',
|
|
|
151
159
|
File.write(get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
|
|
152
160
|
File.close()
|
|
153
161
|
else:
|
|
162
|
+
mesg = str(message) + '\r\n\r\n'
|
|
163
|
+
print(mesg)
|
|
154
164
|
raise ParameterERROR('function write_log Parameter error! hidden must be "no" or "yes"! ')
|
|
155
165
|
elif mode == 'new':
|
|
156
166
|
File = open(LOGFILE, 'w', newline='', encoding='utf-8')
|
|
@@ -164,6 +174,8 @@ def write_log(name, position, level, message, mode='add',
|
|
|
164
174
|
elif hidden == 'no':
|
|
165
175
|
pass
|
|
166
176
|
else:
|
|
177
|
+
mesg = str(message) + '\r\n\r\n'
|
|
178
|
+
print(mesg)
|
|
167
179
|
raise ParameterERROR('function write_log Parameter error! hidden must be "no" or "yes"! ')
|
|
168
180
|
elif position == 'fileCLI':
|
|
169
181
|
if color == 'no':
|
|
@@ -180,6 +192,8 @@ def write_log(name, position, level, message, mode='add',
|
|
|
180
192
|
else:
|
|
181
193
|
print(f'\033[0;37m{LogFlyMessage}\033[0m')
|
|
182
194
|
else:
|
|
195
|
+
mesg = str(message) + '\r\n\r\n'
|
|
196
|
+
print(mesg)
|
|
183
197
|
raise ParameterERROR('function write_log Parameter error! color must be "yes" or "no"! ')
|
|
184
198
|
if mode == 'add':
|
|
185
199
|
File = open(LOGFILE, 'a', newline='', encoding='utf-8')
|
|
@@ -193,6 +207,8 @@ def write_log(name, position, level, message, mode='add',
|
|
|
193
207
|
elif hidden == 'no':
|
|
194
208
|
pass
|
|
195
209
|
else:
|
|
210
|
+
mesg = str(message) + '\r\n\r\n'
|
|
211
|
+
print(mesg)
|
|
196
212
|
raise ParameterERROR('function write_log Parameter error! hidden must be "no" or "yes"! ')
|
|
197
213
|
elif mode == 'new':
|
|
198
214
|
File = open(LOGFILE, 'w', newline='', encoding='utf-8')
|
|
@@ -206,8 +222,12 @@ def write_log(name, position, level, message, mode='add',
|
|
|
206
222
|
elif hidden == 'no':
|
|
207
223
|
pass
|
|
208
224
|
else:
|
|
225
|
+
mesg = str(message) + '\r\n\r\n'
|
|
226
|
+
print(mesg)
|
|
209
227
|
raise ParameterERROR('function write_log Parameter error! mode must be "add" or "new"! ')
|
|
210
228
|
else:
|
|
229
|
+
mesg = str(message) + '\r\n\r\n'
|
|
230
|
+
print(mesg)
|
|
211
231
|
raise ParameterERROR('function write_log Parameter error! position must be "file" or "fileCLI"! ')
|
|
212
232
|
except Exception as e:
|
|
213
233
|
linenum = e.__traceback__.tb_lineno
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: logfly
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2
|
|
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.2
|
|
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
|