LogFly 1.4__tar.gz → 1.6__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-1.4/src/logfly.egg-info → logfly-1.6}/PKG-INFO +5 -4
- {logfly-1.4 → logfly-1.6}/README.md +3 -2
- {logfly-1.4 → logfly-1.6}/setup.py +2 -2
- {logfly-1.4 → logfly-1.6}/src/logfly/__init__.py +25 -7
- logfly-1.6/src/logfly/soundfly/__init__.py +7 -0
- {logfly-1.4 → logfly-1.6/src/logfly.egg-info}/PKG-INFO +5 -4
- {logfly-1.4 → logfly-1.6}/src/logfly.egg-info/SOURCES.txt +2 -1
- {logfly-1.4 → logfly-1.6}/LICENSE +0 -0
- {logfly-1.4 → logfly-1.6}/pyproject.toml +0 -0
- {logfly-1.4 → logfly-1.6}/setup.cfg +0 -0
- {logfly-1.4 → logfly-1.6}/src/logfly.egg-info/dependency_links.txt +0 -0
- {logfly-1.4 → logfly-1.6}/src/logfly.egg-info/top_level.txt +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: logfly
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.6
|
|
4
|
+
Summary: A simple log tool by python
|
|
5
5
|
Home-page: https://about.guki.me
|
|
6
6
|
Author: Yuan Sui
|
|
7
7
|
Author-email: orisui@icloud.com
|
|
@@ -15,7 +15,7 @@ Requires-Python: >=3.6
|
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
17
|
|
|
18
|
-
# logfly 1.
|
|
18
|
+
# logfly 1.6
|
|
19
19
|
### a simple log tool by python
|
|
20
20
|
|
|
21
21
|
## position
|
|
@@ -26,7 +26,7 @@ if use hidden, log will also appear in user/.1o9f1y folder
|
|
|
26
26
|
### import
|
|
27
27
|
import logfly
|
|
28
28
|
### use
|
|
29
|
-
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys', hidden='no', color='yes')
|
|
29
|
+
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys', 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.
|
|
@@ -41,6 +41,7 @@ if use hidden, log will also appear in user/.1o9f1y folder
|
|
|
41
41
|
folder_name: (any str) custom logfly folder name, default is 'logflys'.
|
|
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
|
+
str_message: ('yes', 'no') default is 'yes', means log will print message with str()
|
|
44
45
|
|
|
45
46
|
## Example:
|
|
46
47
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# logfly 1.
|
|
1
|
+
# logfly 1.6
|
|
2
2
|
### a simple log tool by python
|
|
3
3
|
|
|
4
4
|
## position
|
|
@@ -9,7 +9,7 @@ if use hidden, log will also appear in user/.1o9f1y folder
|
|
|
9
9
|
### import
|
|
10
10
|
import logfly
|
|
11
11
|
### use
|
|
12
|
-
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys', hidden='no', color='yes')
|
|
12
|
+
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys', 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.
|
|
@@ -24,6 +24,7 @@ if use hidden, log will also appear in user/.1o9f1y folder
|
|
|
24
24
|
folder_name: (any str) custom logfly folder name, default is 'logflys'.
|
|
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
|
+
str_message: ('yes', 'no') default is 'yes', means log will print message with str()
|
|
27
28
|
|
|
28
29
|
## Example:
|
|
29
30
|
|
|
@@ -5,10 +5,10 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="logfly",
|
|
8
|
-
version="1.
|
|
8
|
+
version="1.6",
|
|
9
9
|
author="Yuan Sui",
|
|
10
10
|
author_email="orisui@icloud.com",
|
|
11
|
-
description="
|
|
11
|
+
description="A simple log tool by python",
|
|
12
12
|
long_description=long_description,
|
|
13
13
|
long_description_content_type="text/markdown",
|
|
14
14
|
url="https://about.guki.me",
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
#####################
|
|
2
2
|
# Author: Yuki Sui
|
|
3
|
-
# Date:
|
|
4
|
-
# Version: 1.4
|
|
3
|
+
# Date: 2022-1-16
|
|
5
4
|
#####################
|
|
6
5
|
|
|
7
6
|
import time
|
|
7
|
+
import shutil
|
|
8
8
|
import os
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
from colorama import init
|
|
11
11
|
|
|
12
12
|
init(autoreset=True)
|
|
13
|
+
__version__ = '1.6'
|
|
13
14
|
|
|
14
15
|
|
|
15
16
|
def create_log_folder(folder_name, hidden):
|
|
@@ -34,16 +35,26 @@ def create_log_folder(folder_name, hidden):
|
|
|
34
35
|
def get_time(flag):
|
|
35
36
|
if flag == 'datetime':
|
|
36
37
|
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
|
37
|
-
|
|
38
|
+
elif flag == 'date':
|
|
38
39
|
return time.strftime("%Y-%m-%d", time.localtime())
|
|
39
|
-
|
|
40
|
+
elif flag == 'times':
|
|
40
41
|
return time.strftime("%H:%M:%S", time.localtime())
|
|
41
|
-
|
|
42
|
+
elif flag == 'datetimefile':
|
|
42
43
|
return time.strftime("%Y%m%d%H%M%S", time.localtime())
|
|
44
|
+
elif flag == 'timestamp':
|
|
45
|
+
return time.time()
|
|
43
46
|
|
|
44
47
|
|
|
45
|
-
|
|
48
|
+
# noinspection PyTypeChecker
|
|
49
|
+
def write_log(name, position, level, message, mode='add',
|
|
50
|
+
folder_name='logflys', hidden='no', color='yes', str_message='yes'):
|
|
46
51
|
global LOGFILE, LOGFILE2, logfolder, logfolder_hidden, LOGFILE_hidden
|
|
52
|
+
if str_message == 'yes':
|
|
53
|
+
message = str(message)
|
|
54
|
+
elif str_message == 'no':
|
|
55
|
+
pass
|
|
56
|
+
else:
|
|
57
|
+
error()
|
|
47
58
|
if hidden == "no":
|
|
48
59
|
logfolder = '.\\logs\\' + folder_name + '\\' + get_time('date') + '\\'
|
|
49
60
|
elif hidden == 'yes':
|
|
@@ -135,8 +146,15 @@ def write_log(name, position, level, message, mode='add', folder_name='logflys',
|
|
|
135
146
|
error()
|
|
136
147
|
|
|
137
148
|
|
|
149
|
+
def mv_file(original_file_name, new_file_name, folder_name='mv_file'):
|
|
150
|
+
shutil.move(original_file_name, new_file_name)
|
|
151
|
+
message = 'File ' + original_file_name + ' moved to ' + new_file_name
|
|
152
|
+
write_log('logfly-log', 'CLI', 'error', message, folder_name=folder_name)
|
|
153
|
+
|
|
154
|
+
|
|
138
155
|
def error():
|
|
139
|
-
logflyErrorMessage = 'your parameter is wrong, please re-check it!'
|
|
156
|
+
logflyErrorMessage = 'your parameter is wrong, please re-check it! \r\nAnd you can see the manual at ' \
|
|
157
|
+
'https://github.com/tinqlo/logfly '
|
|
140
158
|
write_log('logfly-log', 'CLI', 'error', logflyErrorMessage)
|
|
141
159
|
|
|
142
160
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: logfly
|
|
3
|
-
Version: 1.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.6
|
|
4
|
+
Summary: A simple log tool by python
|
|
5
5
|
Home-page: https://about.guki.me
|
|
6
6
|
Author: Yuan Sui
|
|
7
7
|
Author-email: orisui@icloud.com
|
|
@@ -15,7 +15,7 @@ Requires-Python: >=3.6
|
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
17
|
|
|
18
|
-
# logfly 1.
|
|
18
|
+
# logfly 1.6
|
|
19
19
|
### a simple log tool by python
|
|
20
20
|
|
|
21
21
|
## position
|
|
@@ -26,7 +26,7 @@ if use hidden, log will also appear in user/.1o9f1y folder
|
|
|
26
26
|
### import
|
|
27
27
|
import logfly
|
|
28
28
|
### use
|
|
29
|
-
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys', hidden='no', color='yes')
|
|
29
|
+
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys', 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.
|
|
@@ -41,6 +41,7 @@ if use hidden, log will also appear in user/.1o9f1y folder
|
|
|
41
41
|
folder_name: (any str) custom logfly folder name, default is 'logflys'.
|
|
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
|
+
str_message: ('yes', 'no') default is 'yes', means log will print message with str()
|
|
44
45
|
|
|
45
46
|
## Example:
|
|
46
47
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|