LogFly 0.6__tar.gz → 0.8__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-0.6/logfly.egg-info → logfly-0.8}/PKG-INFO +80 -66
- logfly-0.6/PKG-INFO → logfly-0.8/README.md +63 -66
- logfly-0.8/pyproject.toml +6 -0
- {logfly-0.6 → logfly-0.8}/setup.cfg +4 -4
- logfly-0.8/setup.py +26 -0
- logfly-0.6/README.md → logfly-0.8/srcc/logfly.egg-info/PKG-INFO +80 -54
- logfly-0.8/srcc/logfly.egg-info/SOURCES.txt +7 -0
- logfly-0.8/srcc/logfly.egg-info/top_level.txt +1 -0
- logfly-0.6/logfly/__init__.py +0 -66
- logfly-0.6/logfly.egg-info/SOURCES.txt +0 -7
- logfly-0.6/logfly.egg-info/top_level.txt +0 -1
- logfly-0.6/setup.py +0 -17
- {logfly-0.6 → logfly-0.8/srcc}/logfly.egg-info/dependency_links.txt +0 -0
|
@@ -1,66 +1,80 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: logfly
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary:
|
|
5
|
-
Home-page: https://
|
|
6
|
-
Author: Yuan Sui
|
|
7
|
-
Author-email: orisui@icloud.com
|
|
8
|
-
License:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: logfly
|
|
3
|
+
Version: 0.8
|
|
4
|
+
Summary: Aa simple log tool by python
|
|
5
|
+
Home-page: https://about.guki.me
|
|
6
|
+
Author: Yuan Sui
|
|
7
|
+
Author-email: orisui@icloud.com
|
|
8
|
+
License: UNKNOWN
|
|
9
|
+
Project-URL: Github, https://github.com/tinqlo/logfly
|
|
10
|
+
Platform: UNKNOWN
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Requires-Python: >=3.6
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# logfly 0.7
|
|
18
|
+
### a simple log tool by python
|
|
19
|
+
|
|
20
|
+
## position
|
|
21
|
+
log will create in ./logs/[folder_name]/[date] folder.
|
|
22
|
+
|
|
23
|
+
## How to
|
|
24
|
+
### import
|
|
25
|
+
import logfly
|
|
26
|
+
### use
|
|
27
|
+
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys')
|
|
28
|
+
|
|
29
|
+
## Description
|
|
30
|
+
name: (any str) logfile name, you can use diffrent string to create diffrent logfile.
|
|
31
|
+
where: ('CLI', 'fileCLI', 'file') position where log appear.
|
|
32
|
+
fileCLI means log will appear in command line window and log file.
|
|
33
|
+
CLI means log will only appear in command line window.
|
|
34
|
+
file means log will only appear in logfile.
|
|
35
|
+
info: (any str) custom log level, will upper and wrap with '[]'.
|
|
36
|
+
message: (any str) log message.
|
|
37
|
+
mode: ('add', 'new') default is 'add', means log will add in same day.
|
|
38
|
+
'new' means logfile will create when program every once.
|
|
39
|
+
folder_name: (any str) custom logfly folder name, default is 'logflys'.
|
|
40
|
+
|
|
41
|
+
## Example:
|
|
42
|
+
|
|
43
|
+
### both file and CLI code
|
|
44
|
+
logfly.write_log('Doctor Who', 'fileCLI', 'info', "this is Doctor's log, in file and CLI.")
|
|
45
|
+
#### in CLI
|
|
46
|
+
2021-07-29 20:39:07 [INFO] this is Doctor's log, in file and CLI.
|
|
47
|
+
#### in file (logs/logflys/[date]/Doctor Who-2021-07-29.log)
|
|
48
|
+
2021-07-29 20:39:07 [INFO] this is Doctor's log, in file and CLI.
|
|
49
|
+
|
|
50
|
+
### only in CLI code
|
|
51
|
+
logfly.write_log('Doctor Who', 'CLI', 'info', "this is Doctor's log, only in CLI.")
|
|
52
|
+
#### in CLI
|
|
53
|
+
2021-07-29 20:39:07 [INFO] this is Doctor's log, only in CLI.
|
|
54
|
+
#### in file
|
|
55
|
+
None
|
|
56
|
+
|
|
57
|
+
### only in file code
|
|
58
|
+
logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.")
|
|
59
|
+
#### in CLI
|
|
60
|
+
None
|
|
61
|
+
#### in file (logs/logflys/[date]/Doctor Who-2021-07-29.log)
|
|
62
|
+
2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
|
|
63
|
+
|
|
64
|
+
#### mode arg:
|
|
65
|
+
logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.", mode='new')
|
|
66
|
+
#### in CLI:
|
|
67
|
+
2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
|
|
68
|
+
#### infile(logs//logflys[date]/Doctor Who-20210801165807.log):
|
|
69
|
+
#### p.s. log will name in date + time
|
|
70
|
+
|
|
71
|
+
2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
|
|
72
|
+
|
|
73
|
+
#### folder arg:
|
|
74
|
+
write_log('Death Stranding', 'fileCLI', 'info', "this is Death Stranding's log, in file and CLI.", mode='add',folder_name='games')
|
|
75
|
+
#### in CLI:
|
|
76
|
+
2021-11-10 21:27:55 [INFO] this is Death Stranding's log, in file and CLI.
|
|
77
|
+
#### infile(logs/games/[date]/Death Stranding-20210801165807.log):
|
|
78
|
+
|
|
79
|
+
2021-11-10 21:27:55 [INFO] this is Death Stranding's log, in file and CLI.
|
|
80
|
+
|
|
@@ -1,66 +1,63 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
log will
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
####
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
#### in
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
|
|
66
|
-
|
|
1
|
+
# logfly 0.7
|
|
2
|
+
### a simple log tool by python
|
|
3
|
+
|
|
4
|
+
## position
|
|
5
|
+
log will create in ./logs/[folder_name]/[date] folder.
|
|
6
|
+
|
|
7
|
+
## How to
|
|
8
|
+
### import
|
|
9
|
+
import logfly
|
|
10
|
+
### use
|
|
11
|
+
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys')
|
|
12
|
+
|
|
13
|
+
## Description
|
|
14
|
+
name: (any str) logfile name, you can use diffrent string to create diffrent logfile.
|
|
15
|
+
where: ('CLI', 'fileCLI', 'file') position where log appear.
|
|
16
|
+
fileCLI means log will appear in command line window and log file.
|
|
17
|
+
CLI means log will only appear in command line window.
|
|
18
|
+
file means log will only appear in logfile.
|
|
19
|
+
info: (any str) custom log level, will upper and wrap with '[]'.
|
|
20
|
+
message: (any str) log message.
|
|
21
|
+
mode: ('add', 'new') default is 'add', means log will add in same day.
|
|
22
|
+
'new' means logfile will create when program every once.
|
|
23
|
+
folder_name: (any str) custom logfly folder name, default is 'logflys'.
|
|
24
|
+
|
|
25
|
+
## Example:
|
|
26
|
+
|
|
27
|
+
### both file and CLI code
|
|
28
|
+
logfly.write_log('Doctor Who', 'fileCLI', 'info', "this is Doctor's log, in file and CLI.")
|
|
29
|
+
#### in CLI
|
|
30
|
+
2021-07-29 20:39:07 [INFO] this is Doctor's log, in file and CLI.
|
|
31
|
+
#### in file (logs/logflys/[date]/Doctor Who-2021-07-29.log)
|
|
32
|
+
2021-07-29 20:39:07 [INFO] this is Doctor's log, in file and CLI.
|
|
33
|
+
|
|
34
|
+
### only in CLI code
|
|
35
|
+
logfly.write_log('Doctor Who', 'CLI', 'info', "this is Doctor's log, only in CLI.")
|
|
36
|
+
#### in CLI
|
|
37
|
+
2021-07-29 20:39:07 [INFO] this is Doctor's log, only in CLI.
|
|
38
|
+
#### in file
|
|
39
|
+
None
|
|
40
|
+
|
|
41
|
+
### only in file code
|
|
42
|
+
logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.")
|
|
43
|
+
#### in CLI
|
|
44
|
+
None
|
|
45
|
+
#### in file (logs/logflys/[date]/Doctor Who-2021-07-29.log)
|
|
46
|
+
2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
|
|
47
|
+
|
|
48
|
+
#### mode arg:
|
|
49
|
+
logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.", mode='new')
|
|
50
|
+
#### in CLI:
|
|
51
|
+
2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
|
|
52
|
+
#### infile(logs//logflys[date]/Doctor Who-20210801165807.log):
|
|
53
|
+
#### p.s. log will name in date + time
|
|
54
|
+
|
|
55
|
+
2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
|
|
56
|
+
|
|
57
|
+
#### folder arg:
|
|
58
|
+
write_log('Death Stranding', 'fileCLI', 'info', "this is Death Stranding's log, in file and CLI.", mode='add',folder_name='games')
|
|
59
|
+
#### in CLI:
|
|
60
|
+
2021-11-10 21:27:55 [INFO] this is Death Stranding's log, in file and CLI.
|
|
61
|
+
#### infile(logs/games/[date]/Death Stranding-20210801165807.log):
|
|
62
|
+
|
|
63
|
+
2021-11-10 21:27:55 [INFO] this is Death Stranding's log, in file and CLI.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[egg_info]
|
|
2
|
-
tag_build =
|
|
3
|
-
tag_date = 0
|
|
4
|
-
|
|
1
|
+
[egg_info]
|
|
2
|
+
tag_build =
|
|
3
|
+
tag_date = 0
|
|
4
|
+
|
logfly-0.8/setup.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import setuptools
|
|
2
|
+
|
|
3
|
+
with open("README.md", "r", encoding="utf-8") as fh:
|
|
4
|
+
long_description = fh.read()
|
|
5
|
+
|
|
6
|
+
setuptools.setup(
|
|
7
|
+
name="logfly",
|
|
8
|
+
version="0.8",
|
|
9
|
+
author="Yuan Sui",
|
|
10
|
+
author_email="orisui@icloud.com",
|
|
11
|
+
description="Aa simple log tool by python ",
|
|
12
|
+
long_description=long_description,
|
|
13
|
+
long_description_content_type="text/markdown",
|
|
14
|
+
url="https://about.guki.me",
|
|
15
|
+
project_urls={
|
|
16
|
+
"Github": "https://github.com/tinqlo/logfly",
|
|
17
|
+
},
|
|
18
|
+
classifiers=[
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
],
|
|
23
|
+
package_dir={"": "srcc"},
|
|
24
|
+
packages=setuptools.find_packages(where="srcc"),
|
|
25
|
+
python_requires=">=3.6",
|
|
26
|
+
)
|
|
@@ -1,54 +1,80 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
###
|
|
27
|
-
logfly.write_log('
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
####
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
####
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: logfly
|
|
3
|
+
Version: 0.8
|
|
4
|
+
Summary: Aa simple log tool by python
|
|
5
|
+
Home-page: https://about.guki.me
|
|
6
|
+
Author: Yuan Sui
|
|
7
|
+
Author-email: orisui@icloud.com
|
|
8
|
+
License: UNKNOWN
|
|
9
|
+
Project-URL: Github, https://github.com/tinqlo/logfly
|
|
10
|
+
Platform: UNKNOWN
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Requires-Python: >=3.6
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
|
|
17
|
+
# logfly 0.7
|
|
18
|
+
### a simple log tool by python
|
|
19
|
+
|
|
20
|
+
## position
|
|
21
|
+
log will create in ./logs/[folder_name]/[date] folder.
|
|
22
|
+
|
|
23
|
+
## How to
|
|
24
|
+
### import
|
|
25
|
+
import logfly
|
|
26
|
+
### use
|
|
27
|
+
logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys')
|
|
28
|
+
|
|
29
|
+
## Description
|
|
30
|
+
name: (any str) logfile name, you can use diffrent string to create diffrent logfile.
|
|
31
|
+
where: ('CLI', 'fileCLI', 'file') position where log appear.
|
|
32
|
+
fileCLI means log will appear in command line window and log file.
|
|
33
|
+
CLI means log will only appear in command line window.
|
|
34
|
+
file means log will only appear in logfile.
|
|
35
|
+
info: (any str) custom log level, will upper and wrap with '[]'.
|
|
36
|
+
message: (any str) log message.
|
|
37
|
+
mode: ('add', 'new') default is 'add', means log will add in same day.
|
|
38
|
+
'new' means logfile will create when program every once.
|
|
39
|
+
folder_name: (any str) custom logfly folder name, default is 'logflys'.
|
|
40
|
+
|
|
41
|
+
## Example:
|
|
42
|
+
|
|
43
|
+
### both file and CLI code
|
|
44
|
+
logfly.write_log('Doctor Who', 'fileCLI', 'info', "this is Doctor's log, in file and CLI.")
|
|
45
|
+
#### in CLI
|
|
46
|
+
2021-07-29 20:39:07 [INFO] this is Doctor's log, in file and CLI.
|
|
47
|
+
#### in file (logs/logflys/[date]/Doctor Who-2021-07-29.log)
|
|
48
|
+
2021-07-29 20:39:07 [INFO] this is Doctor's log, in file and CLI.
|
|
49
|
+
|
|
50
|
+
### only in CLI code
|
|
51
|
+
logfly.write_log('Doctor Who', 'CLI', 'info', "this is Doctor's log, only in CLI.")
|
|
52
|
+
#### in CLI
|
|
53
|
+
2021-07-29 20:39:07 [INFO] this is Doctor's log, only in CLI.
|
|
54
|
+
#### in file
|
|
55
|
+
None
|
|
56
|
+
|
|
57
|
+
### only in file code
|
|
58
|
+
logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.")
|
|
59
|
+
#### in CLI
|
|
60
|
+
None
|
|
61
|
+
#### in file (logs/logflys/[date]/Doctor Who-2021-07-29.log)
|
|
62
|
+
2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
|
|
63
|
+
|
|
64
|
+
#### mode arg:
|
|
65
|
+
logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.", mode='new')
|
|
66
|
+
#### in CLI:
|
|
67
|
+
2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
|
|
68
|
+
#### infile(logs//logflys[date]/Doctor Who-20210801165807.log):
|
|
69
|
+
#### p.s. log will name in date + time
|
|
70
|
+
|
|
71
|
+
2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
|
|
72
|
+
|
|
73
|
+
#### folder arg:
|
|
74
|
+
write_log('Death Stranding', 'fileCLI', 'info', "this is Death Stranding's log, in file and CLI.", mode='add',folder_name='games')
|
|
75
|
+
#### in CLI:
|
|
76
|
+
2021-11-10 21:27:55 [INFO] this is Death Stranding's log, in file and CLI.
|
|
77
|
+
#### infile(logs/games/[date]/Death Stranding-20210801165807.log):
|
|
78
|
+
|
|
79
|
+
2021-11-10 21:27:55 [INFO] this is Death Stranding's log, in file and CLI.
|
|
80
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
logfly-0.6/logfly/__init__.py
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import time
|
|
2
|
-
import os
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
def create_log_folder():
|
|
6
|
-
dirs = '.\\logs\\'
|
|
7
|
-
dirs2 = '.\\logs\\' + get_time('date')
|
|
8
|
-
if not os.path.exists(dirs):
|
|
9
|
-
os.makedirs(dirs)
|
|
10
|
-
else:
|
|
11
|
-
pass
|
|
12
|
-
if not os.path.exists(dirs2):
|
|
13
|
-
os.makedirs(dirs2)
|
|
14
|
-
else:
|
|
15
|
-
pass
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
def get_time(flag):
|
|
19
|
-
if flag == 'datetime':
|
|
20
|
-
return time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
|
|
21
|
-
if flag == 'date':
|
|
22
|
-
return time.strftime("%Y-%m-%d", time.localtime())
|
|
23
|
-
if flag == 'times':
|
|
24
|
-
return time.strftime("%H:%M:%S", time.localtime())
|
|
25
|
-
if flag == 'datetimefile':
|
|
26
|
-
return time.strftime("%Y%m%d%H%M%S", time.localtime())
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
def write_log(name, position, level, message, mode='add'):
|
|
30
|
-
global LOGFILE
|
|
31
|
-
logfolder = '.\\logs\\' + get_time('date') + '\\'
|
|
32
|
-
if mode == 'add':
|
|
33
|
-
LOGFILE = logfolder + name + '-' + get_time('date') + '.log'
|
|
34
|
-
elif mode == 'new':
|
|
35
|
-
LOGFILE = logfolder + name + '-' + get_time('datetimefile') + '.log'
|
|
36
|
-
create_log_folder()
|
|
37
|
-
if position == 'CLI':
|
|
38
|
-
print(name + ' ' + get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
|
|
39
|
-
if position == 'file':
|
|
40
|
-
if mode == 'add':
|
|
41
|
-
File = open(LOGFILE, 'a', newline='')
|
|
42
|
-
File.write(get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
|
|
43
|
-
File.close()
|
|
44
|
-
elif mode == 'new':
|
|
45
|
-
File = open(LOGFILE, 'w', newline='')
|
|
46
|
-
File.write(get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
|
|
47
|
-
File.close()
|
|
48
|
-
if position == 'fileCLI':
|
|
49
|
-
print(name + ' ' + get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
|
|
50
|
-
if mode == 'add':
|
|
51
|
-
File = open(LOGFILE, 'a', newline='')
|
|
52
|
-
File.write(get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
|
|
53
|
-
File.close()
|
|
54
|
-
elif mode == 'new':
|
|
55
|
-
File = open(LOGFILE, 'w', newline='')
|
|
56
|
-
File.write(get_time('datetime') + ' ' + '[' + str.upper(level) + ']' + ' ' + message + '\r\n')
|
|
57
|
-
File.close()
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if __name__ == '__main__':
|
|
61
|
-
write_log('Doctor Who', 'CLI', 'info', "this is Doctor's log, only in CLI.")
|
|
62
|
-
write_log('Doctor Who', 'fileCLI', 'info', "this is Doctor's log, in file and CLI.", mode='add')
|
|
63
|
-
write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.")
|
|
64
|
-
write_log('Tardis', 'CLI', 'info', "this is Tardis's log, only in CLI.")
|
|
65
|
-
write_log('Tardis', 'fileCLI', 'info', "this is Tardis's log, in file and CLI.")
|
|
66
|
-
write_log('Tardis', 'file', 'info', "this is Tardis's log, only in file.")
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
logfly
|
logfly-0.6/setup.py
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
from distutils.core import setup
|
|
2
|
-
|
|
3
|
-
with open("README.md", "r") as fh:
|
|
4
|
-
long_description = fh.read()
|
|
5
|
-
|
|
6
|
-
setup(
|
|
7
|
-
name='logfly',
|
|
8
|
-
version='0.6',
|
|
9
|
-
packages=['logfly'],
|
|
10
|
-
url='https://github.com/TinQlo/logfly',
|
|
11
|
-
license='MIT License',
|
|
12
|
-
author='Yuan Sui',
|
|
13
|
-
author_email='orisui@icloud.com',
|
|
14
|
-
description='a simple log tool for python',
|
|
15
|
-
long_description=long_description,
|
|
16
|
-
long_description_content_type="text/markdown",
|
|
17
|
-
)
|
|
File without changes
|