LogFly 2.0__tar.gz → 2.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.
- {logfly-2.0/src/logfly.egg-info → logfly-2.1}/PKG-INFO +6 -6
- {logfly-2.0 → logfly-2.1}/README.md +5 -5
- {logfly-2.0 → logfly-2.1}/setup.py +1 -1
- {logfly-2.0 → logfly-2.1}/src/logfly/__init__.py +9 -4
- {logfly-2.0 → logfly-2.1/src/logfly.egg-info}/PKG-INFO +6 -6
- {logfly-2.0 → logfly-2.1}/LICENSE +0 -0
- {logfly-2.0 → logfly-2.1}/pyproject.toml +0 -0
- {logfly-2.0 → logfly-2.1}/setup.cfg +0 -0
- {logfly-2.0 → logfly-2.1}/src/logfly.egg-info/SOURCES.txt +0 -0
- {logfly-2.0 → logfly-2.1}/src/logfly.egg-info/dependency_links.txt +0 -0
- {logfly-2.0 → logfly-2.1}/src/logfly.egg-info/requires.txt +0 -0
- {logfly-2.0 → logfly-2.1}/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.1
|
|
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.1
|
|
19
19
|
### a simple log tool by python.
|
|
20
20
|
|
|
21
21
|
## position
|
|
@@ -25,8 +25,8 @@ if use hidden, log will also appear in user/.1o9f1y folder.
|
|
|
25
25
|
## How to
|
|
26
26
|
### import
|
|
27
27
|
import logfly
|
|
28
|
-
###
|
|
29
|
-
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='
|
|
28
|
+
### write_log
|
|
29
|
+
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='default-log', hidden='no', color='yes', str_message='yes')
|
|
30
30
|
|
|
31
31
|
#### Description
|
|
32
32
|
name: (any str) logfile name, you can use diffrent string to create diffrent logfile.
|
|
@@ -38,12 +38,12 @@ if use hidden, log will also appear in user/.1o9f1y folder.
|
|
|
38
38
|
message: (any str) log message.
|
|
39
39
|
mode: ('add', 'new') default is 'add', means log will add in same day.
|
|
40
40
|
'new' means logfile will create when program every once.
|
|
41
|
-
folder_name: (any str) custom logfly folder name, default is '
|
|
41
|
+
folder_name: (any str) custom logfly folder name, default is 'default-log'.
|
|
42
42
|
hidden: ('yes', 'no') default is 'no', means logfile will save a copy in user/.1o9f1y folder
|
|
43
43
|
color: ('yes', 'no') default is 'yes', means log will with color.
|
|
44
44
|
str_message: ('yes', 'no') default is 'yes', means log will print message with str()
|
|
45
45
|
|
|
46
|
-
###
|
|
46
|
+
### create_or_check_file
|
|
47
47
|
create_or_check_file(pathorfile, name, warning='yes'):
|
|
48
48
|
create or check file.
|
|
49
49
|
pathorfile: ('file', 'path') choose to create file or path.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# logfly 2.
|
|
1
|
+
# logfly 2.1
|
|
2
2
|
### a simple log tool by python.
|
|
3
3
|
|
|
4
4
|
## position
|
|
@@ -8,8 +8,8 @@ if use hidden, log will also appear in user/.1o9f1y folder.
|
|
|
8
8
|
## How to
|
|
9
9
|
### import
|
|
10
10
|
import logfly
|
|
11
|
-
###
|
|
12
|
-
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='
|
|
11
|
+
### write_log
|
|
12
|
+
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='default-log', hidden='no', color='yes', str_message='yes')
|
|
13
13
|
|
|
14
14
|
#### Description
|
|
15
15
|
name: (any str) logfile name, you can use diffrent string to create diffrent logfile.
|
|
@@ -21,12 +21,12 @@ if use hidden, log will also appear in user/.1o9f1y folder.
|
|
|
21
21
|
message: (any str) log message.
|
|
22
22
|
mode: ('add', 'new') default is 'add', means log will add in same day.
|
|
23
23
|
'new' means logfile will create when program every once.
|
|
24
|
-
folder_name: (any str) custom logfly folder name, default is '
|
|
24
|
+
folder_name: (any str) custom logfly folder name, default is 'default-log'.
|
|
25
25
|
hidden: ('yes', 'no') default is 'no', means logfile will save a copy in user/.1o9f1y folder
|
|
26
26
|
color: ('yes', 'no') default is 'yes', means log will with color.
|
|
27
27
|
str_message: ('yes', 'no') default is 'yes', means log will print message with str()
|
|
28
28
|
|
|
29
|
-
###
|
|
29
|
+
### create_or_check_file
|
|
30
30
|
create_or_check_file(pathorfile, name, warning='yes'):
|
|
31
31
|
create or check file.
|
|
32
32
|
pathorfile: ('file', 'path') choose to create file or path.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#####################
|
|
2
2
|
# Author: Yuki Sui
|
|
3
|
-
# Date: 2022-3-
|
|
3
|
+
# Date: 2022-3-11
|
|
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.1'
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
def create_or_check_file(pathorfile, name, warning='yes'):
|
|
@@ -38,7 +38,7 @@ def create_or_check_file(pathorfile, name, warning='yes'):
|
|
|
38
38
|
error(e, linenum)
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
def create_log_folder(folder_name, hidden):
|
|
41
|
+
def create_log_folder(folder_name, hidden='no'):
|
|
42
42
|
dirs = '.\\logs\\'
|
|
43
43
|
dirs2 = '.\\logs\\' + folder_name + '\\' + get_time('date') + '\\'
|
|
44
44
|
dirs3 = str(Path.home()) + '\\.1o9f1y\\' + folder_name + '\\' + get_time('date') + '\\'
|
|
@@ -98,9 +98,10 @@ def time_transfer(time_stamp, flag='timestamp2datetime'):
|
|
|
98
98
|
|
|
99
99
|
# noinspection PyTypeChecker
|
|
100
100
|
def write_log(name, position, level, message, mode='add',
|
|
101
|
-
folder_name='
|
|
101
|
+
folder_name='default-log', hidden='no', color='yes', str_message='yes'):
|
|
102
102
|
global LOGFILE, LOGFILE2, logfolder, logfolder_hidden, LOGFILE_hidden
|
|
103
103
|
try:
|
|
104
|
+
create_log_folder(folder_name)
|
|
104
105
|
if str_message == 'yes':
|
|
105
106
|
message = str(message)
|
|
106
107
|
elif str_message == 'no':
|
|
@@ -235,3 +236,7 @@ def error(exp,linenum, mode='logfly'):
|
|
|
235
236
|
class ParameterERROR(Exception):
|
|
236
237
|
def __init__(self, message):
|
|
237
238
|
self.message = message
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
if __name__ == '__main__':
|
|
242
|
+
write_log('logfly-log', 'fileCLI', 'error', 'test', hidden='yes')
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: logfly
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.1
|
|
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.1
|
|
19
19
|
### a simple log tool by python.
|
|
20
20
|
|
|
21
21
|
## position
|
|
@@ -25,8 +25,8 @@ if use hidden, log will also appear in user/.1o9f1y folder.
|
|
|
25
25
|
## How to
|
|
26
26
|
### import
|
|
27
27
|
import logfly
|
|
28
|
-
###
|
|
29
|
-
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='
|
|
28
|
+
### write_log
|
|
29
|
+
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='default-log', hidden='no', color='yes', str_message='yes')
|
|
30
30
|
|
|
31
31
|
#### Description
|
|
32
32
|
name: (any str) logfile name, you can use diffrent string to create diffrent logfile.
|
|
@@ -38,12 +38,12 @@ if use hidden, log will also appear in user/.1o9f1y folder.
|
|
|
38
38
|
message: (any str) log message.
|
|
39
39
|
mode: ('add', 'new') default is 'add', means log will add in same day.
|
|
40
40
|
'new' means logfile will create when program every once.
|
|
41
|
-
folder_name: (any str) custom logfly folder name, default is '
|
|
41
|
+
folder_name: (any str) custom logfly folder name, default is 'default-log'.
|
|
42
42
|
hidden: ('yes', 'no') default is 'no', means logfile will save a copy in user/.1o9f1y folder
|
|
43
43
|
color: ('yes', 'no') default is 'yes', means log will with color.
|
|
44
44
|
str_message: ('yes', 'no') default is 'yes', means log will print message with str()
|
|
45
45
|
|
|
46
|
-
###
|
|
46
|
+
### create_or_check_file
|
|
47
47
|
create_or_check_file(pathorfile, name, warning='yes'):
|
|
48
48
|
create or check file.
|
|
49
49
|
pathorfile: ('file', 'path') choose to create file or path.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|