Skip to content

Commit

Permalink
- 增加日志中可以直接输入多个参数的功能,除了exception级别的日志.
Browse files Browse the repository at this point in the history
- 优化各个级别的日志中影响性能的判断逻辑.
- 删除已经废弃,不再支持的功能.
- 修改最低支持的Python版本为3.6版本.

Signed-off-by: tinybees <a598824322@163.com>
  • Loading branch information
tinybees committed Jun 15, 2020
1 parent f4314f9 commit dfdd650
Show file tree
Hide file tree
Showing 12 changed files with 226 additions and 299 deletions.
10 changes: 10 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
## Aelog Changelog

###[1.0.4] - 2020-6-14

#### Added
- 增加日志中可以直接输入多个参数的功能,除了exception级别的日志.

#### Changed
- 优化各个级别的日志中影响性能的判断逻辑.
- 删除已经废弃,不再支持的功能.
- 修改最低支持的Python版本为3.6版本.

###[1.0.3] - 2018-12-23

#### Added
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Tiny Bees
Copyright (c) 2020 Tiny Bees

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
38 changes: 20 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,12 @@ List of configuration keys that the aelog extension recognizes:
| AELOG_BACKUP_COUNT | Rotating file count, default 5.|

# Usage
### simple using, not initialized.
### simple using, output log to terminal.
```
import aelog
aelog.init_app(aelog_console=True)
def test_aelog_output_console():
"""
Expand All @@ -52,11 +54,11 @@ def test_aelog_output_console():
Returns:
"""
aelog.debug("simple debug message")
aelog.info("simple info message")
aelog.warning("simple warning message")
aelog.error("simple error message")
aelog.critical("simple critical message")
aelog.debug("simple debug message", "other message")
aelog.info("simple info message", "other message")
aelog.warning("simple warning message", "other message")
aelog.error("simple error message", "other message")
aelog.critical("simple critical message", "other message")
try:
5 / 0
except Exception as e:
Expand All @@ -66,7 +68,7 @@ This will output to the terminal.
![console](https://github.com/raw/tinybees/aelog/master/docs/output_console.png)
- Different levels of logging, different color, the color is cyan, green, yellow, red and 'bold_red,bg_white' in turn.

### To initialize, output log to file and terminal.
### output log to file and terminal.
```
import aelog
from flask import Flask
Expand All @@ -83,11 +85,11 @@ def test_aelog_output_file():
Returns:
"""
aelog.debug("simple debug message")
aelog.info("simple info message")
aelog.warning("simple warning message")
aelog.error("simple error message")
aelog.critical("simple critical message")
aelog.debug("simple debug message", "other message")
aelog.info("simple info message", "other message")
aelog.warning("simple warning message", "other message")
aelog.error("simple error message", "other message")
aelog.critical("simple critical message", "other message")
try:
5 / 0
except Exception as e:
Expand All @@ -98,7 +100,7 @@ This will output to the test.log file and terminal.
- Automatic output is greater than the error information to the 'test_error.log' file.
- Different levels of logging, different color, the color is cyan, green, yellow, red and 'bold_red,bg_white' in turn.

### To initialize, asynchronous output log to file and terminal.
### asynchronous output log to file and terminal.
```
import asyncio
import aelog
Expand All @@ -109,11 +111,11 @@ app = Sanic(__name__)
aelog.init_aelog(app) # Output to the test.log file and terminal
async def test_async_output():
await aelog.async_debug("simple debug message")
await aelog.async_info("simple info message")
await aelog.async_warning("simple warning message")
await aelog.async_error("simple error message")
await aelog.async_critical("simple critical message")
await aelog.async_debug("simple debug message", "other message")
await aelog.async_info("simple info message", "other message")
await aelog.async_warning("simple warning message", "other message")
await aelog.async_error("simple error message", "other message")
await aelog.async_critical("simple critical message", "other message")
try:
5 / 0
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion aelog/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@

from .aelog import *

__version__ = "1.0.3"
__version__ = "1.0.4"
Loading

0 comments on commit dfdd650

Please sign in to comment.