Skip to content

Commit dfdd650

Browse files
committed
- 增加日志中可以直接输入多个参数的功能,除了exception级别的日志.
- 优化各个级别的日志中影响性能的判断逻辑. - 删除已经废弃,不再支持的功能. - 修改最低支持的Python版本为3.6版本. Signed-off-by: tinybees <[email protected]>
1 parent f4314f9 commit dfdd650

File tree

12 files changed

+226
-299
lines changed

12 files changed

+226
-299
lines changed

CHANGES.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
## Aelog Changelog
22

3+
###[1.0.4] - 2020-6-14
4+
5+
#### Added
6+
- 增加日志中可以直接输入多个参数的功能,除了exception级别的日志.
7+
8+
#### Changed
9+
- 优化各个级别的日志中影响性能的判断逻辑.
10+
- 删除已经废弃,不再支持的功能.
11+
- 修改最低支持的Python版本为3.6版本.
12+
313
###[1.0.3] - 2018-12-23
414

515
#### Added

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Tiny Bees
3+
Copyright (c) 2020 Tiny Bees
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,12 @@ List of configuration keys that the aelog extension recognizes:
4040
| AELOG_BACKUP_COUNT | Rotating file count, default 5.|
4141

4242
# Usage
43-
### simple using, not initialized.
43+
### simple using, output log to terminal.
4444
```
4545
import aelog
4646
47+
aelog.init_app(aelog_console=True)
48+
4749
def test_aelog_output_console():
4850
"""
4951
@@ -52,11 +54,11 @@ def test_aelog_output_console():
5254
Returns:
5355
5456
"""
55-
aelog.debug("simple debug message")
56-
aelog.info("simple info message")
57-
aelog.warning("simple warning message")
58-
aelog.error("simple error message")
59-
aelog.critical("simple critical message")
57+
aelog.debug("simple debug message", "other message")
58+
aelog.info("simple info message", "other message")
59+
aelog.warning("simple warning message", "other message")
60+
aelog.error("simple error message", "other message")
61+
aelog.critical("simple critical message", "other message")
6062
try:
6163
5 / 0
6264
except Exception as e:
@@ -66,7 +68,7 @@ This will output to the terminal.
6668
![console](https://raw.githubusercontent.com/tinybees/aelog/master/docs/output_console.png)
6769
- Different levels of logging, different color, the color is cyan, green, yellow, red and 'bold_red,bg_white' in turn.
6870

69-
### To initialize, output log to file and terminal.
71+
### output log to file and terminal.
7072
```
7173
import aelog
7274
from flask import Flask
@@ -83,11 +85,11 @@ def test_aelog_output_file():
8385
Returns:
8486
8587
"""
86-
aelog.debug("simple debug message")
87-
aelog.info("simple info message")
88-
aelog.warning("simple warning message")
89-
aelog.error("simple error message")
90-
aelog.critical("simple critical message")
88+
aelog.debug("simple debug message", "other message")
89+
aelog.info("simple info message", "other message")
90+
aelog.warning("simple warning message", "other message")
91+
aelog.error("simple error message", "other message")
92+
aelog.critical("simple critical message", "other message")
9193
try:
9294
5 / 0
9395
except Exception as e:
@@ -98,7 +100,7 @@ This will output to the test.log file and terminal.
98100
- Automatic output is greater than the error information to the 'test_error.log' file.
99101
- Different levels of logging, different color, the color is cyan, green, yellow, red and 'bold_red,bg_white' in turn.
100102

101-
### To initialize, asynchronous output log to file and terminal.
103+
### asynchronous output log to file and terminal.
102104
```
103105
import asyncio
104106
import aelog
@@ -109,11 +111,11 @@ app = Sanic(__name__)
109111
aelog.init_aelog(app) # Output to the test.log file and terminal
110112
111113
async def test_async_output():
112-
await aelog.async_debug("simple debug message")
113-
await aelog.async_info("simple info message")
114-
await aelog.async_warning("simple warning message")
115-
await aelog.async_error("simple error message")
116-
await aelog.async_critical("simple critical message")
114+
await aelog.async_debug("simple debug message", "other message")
115+
await aelog.async_info("simple info message", "other message")
116+
await aelog.async_warning("simple warning message", "other message")
117+
await aelog.async_error("simple error message", "other message")
118+
await aelog.async_critical("simple critical message", "other message")
117119
try:
118120
5 / 0
119121
except Exception as e:

aelog/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99

1010
from .aelog import *
1111

12-
__version__ = "1.0.3"
12+
__version__ = "1.0.4"

0 commit comments

Comments
 (0)