LogFly 0.6__tar.gz → 0.7__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.
@@ -1,25 +1,30 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: logfly
3
- Version: 0.6
4
- Summary: a simple log tool for python
5
- Home-page: https://github.com/TinQlo/logfly
3
+ Version: 0.7
4
+ Summary: Aa simple log tool by python
5
+ Home-page: https://about.guki.me
6
6
  Author: Yuan Sui
7
7
  Author-email: orisui@icloud.com
8
- License: MIT License
8
+ License: UNKNOWN
9
+ Project-URL: Github, https://github.com/tinqlo/logfly
9
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
10
15
  Description-Content-Type: text/markdown
11
16
 
12
- # logfly
13
- ### a simple log tool for python
17
+ # logfly 0.7
18
+ ### a simple log tool by python
14
19
 
15
20
  ## position
16
- log will create in ./logs/[date] folder.
21
+ log will create in ./logs/[folder_name]/[date] folder.
17
22
 
18
23
  ## How to
19
24
  ### import
20
25
  import logfly
21
26
  ### use
22
- logfly.write_log('name', 'where', 'info', 'message', mode='add')
27
+ logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys')
23
28
 
24
29
  ## Description
25
30
  name: (any str) logfile name, you can use diffrent string to create diffrent logfile.
@@ -31,6 +36,7 @@ log will create in ./logs/[date] folder.
31
36
  message: (any str) log message.
32
37
  mode: ('add', 'new') default is 'add', means log will add in same day.
33
38
  'new' means logfile will create when program every once.
39
+ folder_name: (any str) custom logfly folder name, default is 'logflys'.
34
40
 
35
41
  ## Example:
36
42
 
@@ -38,7 +44,7 @@ log will create in ./logs/[date] folder.
38
44
  logfly.write_log('Doctor Who', 'fileCLI', 'info', "this is Doctor's log, in file and CLI.")
39
45
  #### in CLI
40
46
  2021-07-29 20:39:07 [INFO] this is Doctor's log, in file and CLI.
41
- #### in file (Doctor Who-2021-07-29.log)
47
+ #### in file (logs/logflys/[date]/Doctor Who-2021-07-29.log)
42
48
  2021-07-29 20:39:07 [INFO] this is Doctor's log, in file and CLI.
43
49
 
44
50
  ### only in CLI code
@@ -49,18 +55,26 @@ log will create in ./logs/[date] folder.
49
55
  None
50
56
 
51
57
  ### only in file code
52
- logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, in file and CLI.")
58
+ logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.")
53
59
  #### in CLI
54
60
  None
55
- #### in file (Doctor Who-2021-07-29.log)
61
+ #### in file (logs/logflys/[date]/Doctor Who-2021-07-29.log)
56
62
  2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
57
63
 
58
64
  #### mode arg:
59
- logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, in file and CLI.", mode='new')
65
+ logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.", mode='new')
60
66
  #### in CLI:
61
67
  2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
62
- #### infile(Doctor Who-20210801165807.log):
68
+ #### infile(logs//logflys[date]/Doctor Who-20210801165807.log):
63
69
  #### p.s. log will name in date + time
64
70
 
65
71
  2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
66
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,25 +1,14 @@
1
- Metadata-Version: 2.1
2
- Name: logfly
3
- Version: 0.6
4
- Summary: a simple log tool for python
5
- Home-page: https://github.com/TinQlo/logfly
6
- Author: Yuan Sui
7
- Author-email: orisui@icloud.com
8
- License: MIT License
9
- Platform: UNKNOWN
10
- Description-Content-Type: text/markdown
11
-
12
- # logfly
13
- ### a simple log tool for python
1
+ # logfly 0.7
2
+ ### a simple log tool by python
14
3
 
15
4
  ## position
16
- log will create in ./logs/[date] folder.
5
+ log will create in ./logs/[folder_name]/[date] folder.
17
6
 
18
7
  ## How to
19
8
  ### import
20
9
  import logfly
21
10
  ### use
22
- logfly.write_log('name', 'where', 'info', 'message', mode='add')
11
+ logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys')
23
12
 
24
13
  ## Description
25
14
  name: (any str) logfile name, you can use diffrent string to create diffrent logfile.
@@ -31,6 +20,7 @@ log will create in ./logs/[date] folder.
31
20
  message: (any str) log message.
32
21
  mode: ('add', 'new') default is 'add', means log will add in same day.
33
22
  'new' means logfile will create when program every once.
23
+ folder_name: (any str) custom logfly folder name, default is 'logflys'.
34
24
 
35
25
  ## Example:
36
26
 
@@ -38,7 +28,7 @@ log will create in ./logs/[date] folder.
38
28
  logfly.write_log('Doctor Who', 'fileCLI', 'info', "this is Doctor's log, in file and CLI.")
39
29
  #### in CLI
40
30
  2021-07-29 20:39:07 [INFO] this is Doctor's log, in file and CLI.
41
- #### in file (Doctor Who-2021-07-29.log)
31
+ #### in file (logs/logflys/[date]/Doctor Who-2021-07-29.log)
42
32
  2021-07-29 20:39:07 [INFO] this is Doctor's log, in file and CLI.
43
33
 
44
34
  ### only in CLI code
@@ -49,18 +39,25 @@ log will create in ./logs/[date] folder.
49
39
  None
50
40
 
51
41
  ### only in file code
52
- logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, in file and CLI.")
42
+ logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.")
53
43
  #### in CLI
54
44
  None
55
- #### in file (Doctor Who-2021-07-29.log)
45
+ #### in file (logs/logflys/[date]/Doctor Who-2021-07-29.log)
56
46
  2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
57
47
 
58
48
  #### mode arg:
59
- logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, in file and CLI.", mode='new')
49
+ logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.", mode='new')
60
50
  #### in CLI:
61
51
  2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
62
- #### infile(Doctor Who-20210801165807.log):
52
+ #### infile(logs//logflys[date]/Doctor Who-20210801165807.log):
63
53
  #### p.s. log will name in date + time
64
54
 
65
55
  2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
66
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,14 +1,30 @@
1
- # logfly
2
- ### a simple log tool for python
1
+ Metadata-Version: 2.1
2
+ Name: logfly
3
+ Version: 0.7
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
3
19
 
4
20
  ## position
5
- log will create in ./logs/[date] folder.
21
+ log will create in ./logs/[folder_name]/[date] folder.
6
22
 
7
23
  ## How to
8
24
  ### import
9
25
  import logfly
10
26
  ### use
11
- logfly.write_log('name', 'where', 'info', 'message', mode='add')
27
+ logfly.write_log('name', 'where', 'info', 'message', mode='add', folder_name='logflys')
12
28
 
13
29
  ## Description
14
30
  name: (any str) logfile name, you can use diffrent string to create diffrent logfile.
@@ -20,6 +36,7 @@ log will create in ./logs/[date] folder.
20
36
  message: (any str) log message.
21
37
  mode: ('add', 'new') default is 'add', means log will add in same day.
22
38
  'new' means logfile will create when program every once.
39
+ folder_name: (any str) custom logfly folder name, default is 'logflys'.
23
40
 
24
41
  ## Example:
25
42
 
@@ -27,7 +44,7 @@ log will create in ./logs/[date] folder.
27
44
  logfly.write_log('Doctor Who', 'fileCLI', 'info', "this is Doctor's log, in file and CLI.")
28
45
  #### in CLI
29
46
  2021-07-29 20:39:07 [INFO] this is Doctor's log, in file and CLI.
30
- #### in file (Doctor Who-2021-07-29.log)
47
+ #### in file (logs/logflys/[date]/Doctor Who-2021-07-29.log)
31
48
  2021-07-29 20:39:07 [INFO] this is Doctor's log, in file and CLI.
32
49
 
33
50
  ### only in CLI code
@@ -38,17 +55,26 @@ log will create in ./logs/[date] folder.
38
55
  None
39
56
 
40
57
  ### only in file code
41
- logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, in file and CLI.")
58
+ logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.")
42
59
  #### in CLI
43
60
  None
44
- #### in file (Doctor Who-2021-07-29.log)
61
+ #### in file (logs/logflys/[date]/Doctor Who-2021-07-29.log)
45
62
  2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
46
63
 
47
64
  #### mode arg:
48
- logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, in file and CLI.", mode='new')
65
+ logfly.write_log('Doctor Who', 'file', 'info', "this is Doctor's log, only in file.", mode='new')
49
66
  #### in CLI:
50
67
  2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
51
- #### infile(Doctor Who-20210801165807.log):
68
+ #### infile(logs//logflys[date]/Doctor Who-20210801165807.log):
52
69
  #### p.s. log will name in date + time
53
70
 
54
- 2021-07-29 20:40:03 [INFO] this is Doctor's log, only in file.
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,7 @@
1
+ README.md
2
+ pyproject.toml
3
+ setup.py
4
+ dist/logfly.egg-info/PKG-INFO
5
+ dist/logfly.egg-info/SOURCES.txt
6
+ dist/logfly.egg-info/dependency_links.txt
7
+ dist/logfly.egg-info/top_level.txt
@@ -0,0 +1,6 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools>=42",
4
+ "wheel"
5
+ ]
6
+ build-backend = "setuptools.build_meta"
logfly-0.7/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.7",
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={"": "dist"},
24
+ packages=setuptools.find_packages(where="dist"),
25
+ python_requires=">=3.6",
26
+ )
@@ -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,7 +0,0 @@
1
- README.md
2
- setup.py
3
- logfly/__init__.py
4
- logfly.egg-info/PKG-INFO
5
- logfly.egg-info/SOURCES.txt
6
- logfly.egg-info/dependency_links.txt
7
- logfly.egg-info/top_level.txt
@@ -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