llog 1.3.1__tar.gz → 1.4.0__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.
- llog-1.4.0/PKG-INFO +116 -0
- {llog-1.3.1 → llog-1.4.0}/README.md +4 -1
- {llog-1.3.1 → llog-1.4.0}/llog/__init__.py +2 -2
- llog-1.4.0/llog/test/my_log_admin.py +11 -0
- llog-1.4.0/llog/test/some_parts.py +15 -0
- llog-1.4.0/llog/test/test_root.py +18 -0
- llog-1.4.0/llog/test.py +11 -0
- llog-1.4.0/llog.egg-info/PKG-INFO +116 -0
- {llog-1.3.1 → llog-1.4.0}/llog.egg-info/SOURCES.txt +5 -1
- {llog-1.3.1 → llog-1.4.0}/llog.egg-info/requires.txt +1 -1
- llog-1.4.0/llog.egg-info/top_level.txt +2 -0
- llog-1.4.0/setup.py +29 -0
- llog-1.3.1/PKG-INFO +0 -113
- llog-1.3.1/llog.egg-info/PKG-INFO +0 -113
- llog-1.3.1/llog.egg-info/top_level.txt +0 -1
- llog-1.3.1/setup.py +0 -26
- {llog-1.3.1 → llog-1.4.0}/llog.egg-info/dependency_links.txt +0 -0
- {llog-1.3.1 → llog-1.4.0}/setup.cfg +0 -0
llog-1.4.0/PKG-INFO
ADDED
@@ -0,0 +1,116 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: llog
|
3
|
+
Version: 1.4.0
|
4
|
+
Summary: local log (a logging tool that doesn't pollute the global scope)
|
5
|
+
Home-page: https://github.co.jp/
|
6
|
+
Author: bib_inf
|
7
|
+
Author-email: contact.bibinf@gmail.com
|
8
|
+
License: CC0 v1.0
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
10
|
+
Classifier: Topic :: Software Development :: Libraries
|
11
|
+
Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
|
12
|
+
Description-Content-Type: text/markdown
|
13
|
+
|
14
|
+
※下の方に日本語の説明があります
|
15
|
+
|
16
|
+
## English description
|
17
|
+
This package a logging tool that doesn't pollute the global scope.
|
18
|
+
|
19
|
+
How to use
|
20
|
+
|
21
|
+
```python
|
22
|
+
from llog import LLog
|
23
|
+
|
24
|
+
test_log = LLog("./test_log.log")
|
25
|
+
test_log.debug({"msg": "test1"})
|
26
|
+
test_log.debug({"msg": "test2"})
|
27
|
+
test_log.debug({"msg": "test3"})
|
28
|
+
|
29
|
+
```
|
30
|
+
|
31
|
+
Output result: test_log.log
|
32
|
+
```json
|
33
|
+
{"date": "2020-09-22 03:32:59.614418", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test1"}}
|
34
|
+
{"date": "2020-09-22 03:32:59.616413", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test2"}}
|
35
|
+
{"date": "2020-09-22 03:32:59.617411", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test3"}}
|
36
|
+
```
|
37
|
+
|
38
|
+
You can check the contents of the log file (the last n entries) as follows:
|
39
|
+
|
40
|
+
```python
|
41
|
+
test_log.tail(n = 2)
|
42
|
+
```
|
43
|
+
|
44
|
+
Result: standard output (console)
|
45
|
+
```
|
46
|
+
[log #1] {
|
47
|
+
"date": "2020-09-22 03:32:59.616413",
|
48
|
+
"level": "DEBUG",
|
49
|
+
"summary_stack": {
|
50
|
+
"function": "<module>",
|
51
|
+
"filename": "test_root.py"
|
52
|
+
},
|
53
|
+
"contents": {"msg": "test2"}
|
54
|
+
}
|
55
|
+
[log #2] {
|
56
|
+
"date": "2020-09-22 03:32:59.617411",
|
57
|
+
"level": "DEBUG",
|
58
|
+
"summary_stack": {
|
59
|
+
"function": "<module>",
|
60
|
+
"filename": "test_root.py"
|
61
|
+
},
|
62
|
+
"contents": {"msg": "test3"}
|
63
|
+
}
|
64
|
+
```
|
65
|
+
|
66
|
+
## 日本語の説明
|
67
|
+
ログの設定範囲を細かく管理できるログツール (他ツールのログ設定と競合しない)
|
68
|
+
|
69
|
+
簡単な使い方
|
70
|
+
```python
|
71
|
+
from llog import LLog
|
72
|
+
|
73
|
+
test_log = LLog("./test_log.log")
|
74
|
+
test_log.debug({"msg": "test1"})
|
75
|
+
test_log.debug({"msg": "test2"})
|
76
|
+
test_log.debug({"msg": "test3"})
|
77
|
+
|
78
|
+
```
|
79
|
+
|
80
|
+
出力結果: test_log.log
|
81
|
+
```json
|
82
|
+
{"date": "2020-09-22 03:32:59.614418", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test1"}}
|
83
|
+
{"date": "2020-09-22 03:32:59.616413", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test2"}}
|
84
|
+
{"date": "2020-09-22 03:32:59.617411", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test3"}}
|
85
|
+
```
|
86
|
+
|
87
|
+
ログファイルの内容 (末尾n件) を以下のように確認できます。
|
88
|
+
|
89
|
+
```python
|
90
|
+
test_log.tail(n = 2)
|
91
|
+
```
|
92
|
+
|
93
|
+
結果: 標準出力 (コンソール)
|
94
|
+
```
|
95
|
+
[log #1] {
|
96
|
+
"date": "2020-09-22 03:32:59.616413",
|
97
|
+
"level": "DEBUG",
|
98
|
+
"summary_stack": {
|
99
|
+
"function": "<module>",
|
100
|
+
"filename": "test_root.py"
|
101
|
+
},
|
102
|
+
"contents": {"msg": "test2"}
|
103
|
+
}
|
104
|
+
[log #2] {
|
105
|
+
"date": "2020-09-22 03:32:59.617411",
|
106
|
+
"level": "DEBUG",
|
107
|
+
"summary_stack": {
|
108
|
+
"function": "<module>",
|
109
|
+
"filename": "test_root.py"
|
110
|
+
},
|
111
|
+
"contents": {"msg": "test3"}
|
112
|
+
}
|
113
|
+
```
|
114
|
+
|
115
|
+
なお、 show_flag = False オプション引数で標準出力がoffにできます。
|
116
|
+
また、どちらの場合であっても、標準出力の他に返値として末尾ログ一覧が返ります。
|
@@ -3,11 +3,11 @@
|
|
3
3
|
|
4
4
|
import os
|
5
5
|
import sys
|
6
|
+
import fies
|
6
7
|
import json
|
7
8
|
import inspect
|
8
9
|
from sout import sout
|
9
10
|
from datetime import datetime
|
10
|
-
from fileinit import fileinit
|
11
11
|
|
12
12
|
# スタックの情報
|
13
13
|
def get_stack_info(stack_back_offset):
|
@@ -24,7 +24,7 @@ class LLog:
|
|
24
24
|
self.additional = additional # 追加記録事項
|
25
25
|
if self.additional is None: self.additional = {}
|
26
26
|
# ログ出力ファイルの作成
|
27
|
-
|
27
|
+
if self.filename not in fies: fies[self.filename] = ""
|
28
28
|
# ログ出力 (level: debug) [llog]
|
29
29
|
def debug(self, log_contents):
|
30
30
|
self.__output_log("DEBUG", log_contents, full_stack_flag = False)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
|
2
|
+
import sys
|
3
|
+
import time
|
4
|
+
from my_log_admin import main_logger
|
5
|
+
|
6
|
+
def my_func():
|
7
|
+
# ログ出力 (level: debug) [llog]
|
8
|
+
main_logger.debug({"event": "1+1 calculation started"})
|
9
|
+
time.sleep(1)
|
10
|
+
result = 1+1
|
11
|
+
# ログ出力 (level: debug) [llog]
|
12
|
+
main_logger.debug({
|
13
|
+
"event": "1+1 calculation finished",
|
14
|
+
"result": result
|
15
|
+
})
|
@@ -0,0 +1,18 @@
|
|
1
|
+
|
2
|
+
import sys
|
3
|
+
from my_log_admin import main_logger
|
4
|
+
from some_parts import my_func
|
5
|
+
|
6
|
+
# ログ出力 (level: info) [llog]
|
7
|
+
main_logger.info({"event": "app_boot"})
|
8
|
+
my_func()
|
9
|
+
# ログ出力 (level: info) [llog]
|
10
|
+
main_logger.info({"event": "app_terminated"})
|
11
|
+
|
12
|
+
# 最新ログのレビュー (標準出力)
|
13
|
+
main_logger.tail(n = 3)
|
14
|
+
|
15
|
+
obj = main_logger.tail(n = 3, show_flag = False)
|
16
|
+
print(str(obj)[:100])
|
17
|
+
|
18
|
+
print("%d records"%len(main_logger))
|
llog-1.4.0/llog/test.py
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# local log (globalスコープを汚さないログツール) [llog]
|
2
|
+
# 【動作確認 / 使用例】
|
3
|
+
|
4
|
+
import sys
|
5
|
+
import time
|
6
|
+
import ezpip
|
7
|
+
llog = ezpip.load_develop("llog", "../", develop_flag = True)
|
8
|
+
|
9
|
+
test_log = llog.LLog("./test_log.log")
|
10
|
+
test_log.debug({"msg": "test1"})
|
11
|
+
test_log.debug({"msg": "test2"})
|
@@ -0,0 +1,116 @@
|
|
1
|
+
Metadata-Version: 2.1
|
2
|
+
Name: llog
|
3
|
+
Version: 1.4.0
|
4
|
+
Summary: local log (a logging tool that doesn't pollute the global scope)
|
5
|
+
Home-page: https://github.co.jp/
|
6
|
+
Author: bib_inf
|
7
|
+
Author-email: contact.bibinf@gmail.com
|
8
|
+
License: CC0 v1.0
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
10
|
+
Classifier: Topic :: Software Development :: Libraries
|
11
|
+
Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
|
12
|
+
Description-Content-Type: text/markdown
|
13
|
+
|
14
|
+
※下の方に日本語の説明があります
|
15
|
+
|
16
|
+
## English description
|
17
|
+
This package a logging tool that doesn't pollute the global scope.
|
18
|
+
|
19
|
+
How to use
|
20
|
+
|
21
|
+
```python
|
22
|
+
from llog import LLog
|
23
|
+
|
24
|
+
test_log = LLog("./test_log.log")
|
25
|
+
test_log.debug({"msg": "test1"})
|
26
|
+
test_log.debug({"msg": "test2"})
|
27
|
+
test_log.debug({"msg": "test3"})
|
28
|
+
|
29
|
+
```
|
30
|
+
|
31
|
+
Output result: test_log.log
|
32
|
+
```json
|
33
|
+
{"date": "2020-09-22 03:32:59.614418", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test1"}}
|
34
|
+
{"date": "2020-09-22 03:32:59.616413", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test2"}}
|
35
|
+
{"date": "2020-09-22 03:32:59.617411", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test3"}}
|
36
|
+
```
|
37
|
+
|
38
|
+
You can check the contents of the log file (the last n entries) as follows:
|
39
|
+
|
40
|
+
```python
|
41
|
+
test_log.tail(n = 2)
|
42
|
+
```
|
43
|
+
|
44
|
+
Result: standard output (console)
|
45
|
+
```
|
46
|
+
[log #1] {
|
47
|
+
"date": "2020-09-22 03:32:59.616413",
|
48
|
+
"level": "DEBUG",
|
49
|
+
"summary_stack": {
|
50
|
+
"function": "<module>",
|
51
|
+
"filename": "test_root.py"
|
52
|
+
},
|
53
|
+
"contents": {"msg": "test2"}
|
54
|
+
}
|
55
|
+
[log #2] {
|
56
|
+
"date": "2020-09-22 03:32:59.617411",
|
57
|
+
"level": "DEBUG",
|
58
|
+
"summary_stack": {
|
59
|
+
"function": "<module>",
|
60
|
+
"filename": "test_root.py"
|
61
|
+
},
|
62
|
+
"contents": {"msg": "test3"}
|
63
|
+
}
|
64
|
+
```
|
65
|
+
|
66
|
+
## 日本語の説明
|
67
|
+
ログの設定範囲を細かく管理できるログツール (他ツールのログ設定と競合しない)
|
68
|
+
|
69
|
+
簡単な使い方
|
70
|
+
```python
|
71
|
+
from llog import LLog
|
72
|
+
|
73
|
+
test_log = LLog("./test_log.log")
|
74
|
+
test_log.debug({"msg": "test1"})
|
75
|
+
test_log.debug({"msg": "test2"})
|
76
|
+
test_log.debug({"msg": "test3"})
|
77
|
+
|
78
|
+
```
|
79
|
+
|
80
|
+
出力結果: test_log.log
|
81
|
+
```json
|
82
|
+
{"date": "2020-09-22 03:32:59.614418", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test1"}}
|
83
|
+
{"date": "2020-09-22 03:32:59.616413", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test2"}}
|
84
|
+
{"date": "2020-09-22 03:32:59.617411", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test3"}}
|
85
|
+
```
|
86
|
+
|
87
|
+
ログファイルの内容 (末尾n件) を以下のように確認できます。
|
88
|
+
|
89
|
+
```python
|
90
|
+
test_log.tail(n = 2)
|
91
|
+
```
|
92
|
+
|
93
|
+
結果: 標準出力 (コンソール)
|
94
|
+
```
|
95
|
+
[log #1] {
|
96
|
+
"date": "2020-09-22 03:32:59.616413",
|
97
|
+
"level": "DEBUG",
|
98
|
+
"summary_stack": {
|
99
|
+
"function": "<module>",
|
100
|
+
"filename": "test_root.py"
|
101
|
+
},
|
102
|
+
"contents": {"msg": "test2"}
|
103
|
+
}
|
104
|
+
[log #2] {
|
105
|
+
"date": "2020-09-22 03:32:59.617411",
|
106
|
+
"level": "DEBUG",
|
107
|
+
"summary_stack": {
|
108
|
+
"function": "<module>",
|
109
|
+
"filename": "test_root.py"
|
110
|
+
},
|
111
|
+
"contents": {"msg": "test3"}
|
112
|
+
}
|
113
|
+
```
|
114
|
+
|
115
|
+
なお、 show_flag = False オプション引数で標準出力がoffにできます。
|
116
|
+
また、どちらの場合であっても、標準出力の他に返値として末尾ログ一覧が返ります。
|
@@ -1,8 +1,12 @@
|
|
1
1
|
README.md
|
2
2
|
setup.py
|
3
3
|
llog/__init__.py
|
4
|
+
llog/test.py
|
4
5
|
llog.egg-info/PKG-INFO
|
5
6
|
llog.egg-info/SOURCES.txt
|
6
7
|
llog.egg-info/dependency_links.txt
|
7
8
|
llog.egg-info/requires.txt
|
8
|
-
llog.egg-info/top_level.txt
|
9
|
+
llog.egg-info/top_level.txt
|
10
|
+
llog/test/my_log_admin.py
|
11
|
+
llog/test/some_parts.py
|
12
|
+
llog/test/test_root.py
|
llog-1.4.0/setup.py
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
from setuptools import setup
|
3
|
+
# 公開用パッケージの作成 [ezpip]
|
4
|
+
import ezpip
|
5
|
+
|
6
|
+
# 公開用パッケージの作成 [ezpip]
|
7
|
+
with ezpip.packager(develop_dir = "./_develop_llog/") as p:
|
8
|
+
setup(
|
9
|
+
name = "llog",
|
10
|
+
version = "1.4.0",
|
11
|
+
description = "local log (a logging tool that doesn't pollute the global scope)",
|
12
|
+
author = "bib_inf",
|
13
|
+
author_email = "contact.bibinf@gmail.com",
|
14
|
+
url = "https://github.co.jp/",
|
15
|
+
packages = p.packages,
|
16
|
+
install_requires = ["relpath", "sout", "fies>=1.6.0"],
|
17
|
+
long_description = p.long_description,
|
18
|
+
long_description_content_type = "text/markdown",
|
19
|
+
license = "CC0 v1.0",
|
20
|
+
classifiers = [
|
21
|
+
"Programming Language :: Python :: 3",
|
22
|
+
"Topic :: Software Development :: Libraries",
|
23
|
+
"License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication"
|
24
|
+
],
|
25
|
+
# entry_points = """
|
26
|
+
# [console_scripts]
|
27
|
+
# py6 = py6:console_command
|
28
|
+
# """
|
29
|
+
)
|
llog-1.3.1/PKG-INFO
DELETED
@@ -1,113 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: llog
|
3
|
-
Version: 1.3.1
|
4
|
-
Summary: local log (a logging tool that doesn't pollute the global scope)
|
5
|
-
Home-page: https://github.co.jp/
|
6
|
-
Author: bib_inf
|
7
|
-
Author-email: contact.bibinf@gmail.com
|
8
|
-
License: CC0 v1.0
|
9
|
-
Description: ※下の方に日本語の説明があります
|
10
|
-
|
11
|
-
## English description
|
12
|
-
This package a logging tool that doesn't pollute the global scope.
|
13
|
-
|
14
|
-
How to use
|
15
|
-
|
16
|
-
```python
|
17
|
-
from llog import LLog
|
18
|
-
|
19
|
-
test_log = LLog("./test_log.log")
|
20
|
-
test_log.debug({"msg": "test1"})
|
21
|
-
test_log.debug({"msg": "test2"})
|
22
|
-
test_log.debug({"msg": "test3"})
|
23
|
-
|
24
|
-
```
|
25
|
-
|
26
|
-
Output result: test_log.log
|
27
|
-
```json
|
28
|
-
{"date": "2020-09-22 03:32:59.614418", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test1"}}
|
29
|
-
{"date": "2020-09-22 03:32:59.616413", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test2"}}
|
30
|
-
{"date": "2020-09-22 03:32:59.617411", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test3"}}
|
31
|
-
```
|
32
|
-
|
33
|
-
You can check the contents of the log file (the last n entries) as follows:
|
34
|
-
|
35
|
-
```python
|
36
|
-
test_log.tail(n = 2)
|
37
|
-
```
|
38
|
-
|
39
|
-
Result: standard output (console)
|
40
|
-
```
|
41
|
-
[log #1] {
|
42
|
-
"date": "2020-09-22 03:32:59.616413",
|
43
|
-
"level": "DEBUG",
|
44
|
-
"summary_stack": {
|
45
|
-
"function": "<module>",
|
46
|
-
"filename": "test_root.py"
|
47
|
-
},
|
48
|
-
"contents": {"msg": "test2"}
|
49
|
-
}
|
50
|
-
[log #2] {
|
51
|
-
"date": "2020-09-22 03:32:59.617411",
|
52
|
-
"level": "DEBUG",
|
53
|
-
"summary_stack": {
|
54
|
-
"function": "<module>",
|
55
|
-
"filename": "test_root.py"
|
56
|
-
},
|
57
|
-
"contents": {"msg": "test3"}
|
58
|
-
}
|
59
|
-
```
|
60
|
-
|
61
|
-
## 日本語の説明
|
62
|
-
ログの設定範囲を細かく管理できるログツール (他ツールのログ設定と競合しない)
|
63
|
-
|
64
|
-
簡単な使い方
|
65
|
-
```python
|
66
|
-
from llog import LLog
|
67
|
-
|
68
|
-
test_log = LLog("./test_log.log")
|
69
|
-
test_log.debug({"msg": "test1"})
|
70
|
-
test_log.debug({"msg": "test2"})
|
71
|
-
test_log.debug({"msg": "test3"})
|
72
|
-
|
73
|
-
```
|
74
|
-
|
75
|
-
出力結果: test_log.log
|
76
|
-
```json
|
77
|
-
{"date": "2020-09-22 03:32:59.614418", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test1"}}
|
78
|
-
{"date": "2020-09-22 03:32:59.616413", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test2"}}
|
79
|
-
{"date": "2020-09-22 03:32:59.617411", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test3"}}
|
80
|
-
```
|
81
|
-
|
82
|
-
ログファイルの内容 (末尾n件) を以下のように確認できます。
|
83
|
-
|
84
|
-
```python
|
85
|
-
test_log.tail(n = 2)
|
86
|
-
```
|
87
|
-
|
88
|
-
結果: 標準出力 (コンソール)
|
89
|
-
```
|
90
|
-
[log #1] {
|
91
|
-
"date": "2020-09-22 03:32:59.616413",
|
92
|
-
"level": "DEBUG",
|
93
|
-
"summary_stack": {
|
94
|
-
"function": "<module>",
|
95
|
-
"filename": "test_root.py"
|
96
|
-
},
|
97
|
-
"contents": {"msg": "test2"}
|
98
|
-
}
|
99
|
-
[log #2] {
|
100
|
-
"date": "2020-09-22 03:32:59.617411",
|
101
|
-
"level": "DEBUG",
|
102
|
-
"summary_stack": {
|
103
|
-
"function": "<module>",
|
104
|
-
"filename": "test_root.py"
|
105
|
-
},
|
106
|
-
"contents": {"msg": "test3"}
|
107
|
-
}
|
108
|
-
```
|
109
|
-
Platform: UNKNOWN
|
110
|
-
Classifier: Programming Language :: Python :: 3
|
111
|
-
Classifier: Topic :: Software Development :: Libraries
|
112
|
-
Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
|
113
|
-
Description-Content-Type: text/markdown
|
@@ -1,113 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.1
|
2
|
-
Name: llog
|
3
|
-
Version: 1.3.1
|
4
|
-
Summary: local log (a logging tool that doesn't pollute the global scope)
|
5
|
-
Home-page: https://github.co.jp/
|
6
|
-
Author: bib_inf
|
7
|
-
Author-email: contact.bibinf@gmail.com
|
8
|
-
License: CC0 v1.0
|
9
|
-
Description: ※下の方に日本語の説明があります
|
10
|
-
|
11
|
-
## English description
|
12
|
-
This package a logging tool that doesn't pollute the global scope.
|
13
|
-
|
14
|
-
How to use
|
15
|
-
|
16
|
-
```python
|
17
|
-
from llog import LLog
|
18
|
-
|
19
|
-
test_log = LLog("./test_log.log")
|
20
|
-
test_log.debug({"msg": "test1"})
|
21
|
-
test_log.debug({"msg": "test2"})
|
22
|
-
test_log.debug({"msg": "test3"})
|
23
|
-
|
24
|
-
```
|
25
|
-
|
26
|
-
Output result: test_log.log
|
27
|
-
```json
|
28
|
-
{"date": "2020-09-22 03:32:59.614418", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test1"}}
|
29
|
-
{"date": "2020-09-22 03:32:59.616413", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test2"}}
|
30
|
-
{"date": "2020-09-22 03:32:59.617411", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test3"}}
|
31
|
-
```
|
32
|
-
|
33
|
-
You can check the contents of the log file (the last n entries) as follows:
|
34
|
-
|
35
|
-
```python
|
36
|
-
test_log.tail(n = 2)
|
37
|
-
```
|
38
|
-
|
39
|
-
Result: standard output (console)
|
40
|
-
```
|
41
|
-
[log #1] {
|
42
|
-
"date": "2020-09-22 03:32:59.616413",
|
43
|
-
"level": "DEBUG",
|
44
|
-
"summary_stack": {
|
45
|
-
"function": "<module>",
|
46
|
-
"filename": "test_root.py"
|
47
|
-
},
|
48
|
-
"contents": {"msg": "test2"}
|
49
|
-
}
|
50
|
-
[log #2] {
|
51
|
-
"date": "2020-09-22 03:32:59.617411",
|
52
|
-
"level": "DEBUG",
|
53
|
-
"summary_stack": {
|
54
|
-
"function": "<module>",
|
55
|
-
"filename": "test_root.py"
|
56
|
-
},
|
57
|
-
"contents": {"msg": "test3"}
|
58
|
-
}
|
59
|
-
```
|
60
|
-
|
61
|
-
## 日本語の説明
|
62
|
-
ログの設定範囲を細かく管理できるログツール (他ツールのログ設定と競合しない)
|
63
|
-
|
64
|
-
簡単な使い方
|
65
|
-
```python
|
66
|
-
from llog import LLog
|
67
|
-
|
68
|
-
test_log = LLog("./test_log.log")
|
69
|
-
test_log.debug({"msg": "test1"})
|
70
|
-
test_log.debug({"msg": "test2"})
|
71
|
-
test_log.debug({"msg": "test3"})
|
72
|
-
|
73
|
-
```
|
74
|
-
|
75
|
-
出力結果: test_log.log
|
76
|
-
```json
|
77
|
-
{"date": "2020-09-22 03:32:59.614418", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test1"}}
|
78
|
-
{"date": "2020-09-22 03:32:59.616413", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test2"}}
|
79
|
-
{"date": "2020-09-22 03:32:59.617411", "level": "DEBUG", "summary_stack": {"function": "<module>", "filename": "test_root.py"}, "contents": {"msg": "test3"}}
|
80
|
-
```
|
81
|
-
|
82
|
-
ログファイルの内容 (末尾n件) を以下のように確認できます。
|
83
|
-
|
84
|
-
```python
|
85
|
-
test_log.tail(n = 2)
|
86
|
-
```
|
87
|
-
|
88
|
-
結果: 標準出力 (コンソール)
|
89
|
-
```
|
90
|
-
[log #1] {
|
91
|
-
"date": "2020-09-22 03:32:59.616413",
|
92
|
-
"level": "DEBUG",
|
93
|
-
"summary_stack": {
|
94
|
-
"function": "<module>",
|
95
|
-
"filename": "test_root.py"
|
96
|
-
},
|
97
|
-
"contents": {"msg": "test2"}
|
98
|
-
}
|
99
|
-
[log #2] {
|
100
|
-
"date": "2020-09-22 03:32:59.617411",
|
101
|
-
"level": "DEBUG",
|
102
|
-
"summary_stack": {
|
103
|
-
"function": "<module>",
|
104
|
-
"filename": "test_root.py"
|
105
|
-
},
|
106
|
-
"contents": {"msg": "test3"}
|
107
|
-
}
|
108
|
-
```
|
109
|
-
Platform: UNKNOWN
|
110
|
-
Classifier: Programming Language :: Python :: 3
|
111
|
-
Classifier: Topic :: Software Development :: Libraries
|
112
|
-
Classifier: License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
|
113
|
-
Description-Content-Type: text/markdown
|
@@ -1 +0,0 @@
|
|
1
|
-
llog
|
llog-1.3.1/setup.py
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
from setuptools import setup
|
2
|
-
import pypandoc
|
3
|
-
|
4
|
-
with open('./README.md', encoding='utf-8') as f:
|
5
|
-
long_description = f.read()
|
6
|
-
|
7
|
-
# rst_description = pypandoc.convert_text(long_description, 'rst', format='markdown_github')
|
8
|
-
|
9
|
-
setup(
|
10
|
-
name = "llog",
|
11
|
-
version = "1.3.1",
|
12
|
-
description = "local log (a logging tool that doesn't pollute the global scope)",
|
13
|
-
author = "bib_inf",
|
14
|
-
author_email = "contact.bibinf@gmail.com",
|
15
|
-
url = "https://github.co.jp/",
|
16
|
-
packages = ["llog"],
|
17
|
-
install_requires = ["relpath", "sout", "fileinit"],
|
18
|
-
long_description = long_description,
|
19
|
-
long_description_content_type = "text/markdown",
|
20
|
-
license="CC0 v1.0",
|
21
|
-
classifiers=[
|
22
|
-
'Programming Language :: Python :: 3',
|
23
|
-
'Topic :: Software Development :: Libraries',
|
24
|
-
'License :: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication'
|
25
|
-
]
|
26
|
-
)
|
File without changes
|
File without changes
|