python的简单记录器
DavesLogger的Python项目详细描述
daveslogger
A simple but in depth logger for Python, Customize by Composition.
这个工具的思想是编写日志函数,这样您就可以使日志看起来完全符合您的需要。
Dave's logger3, but written in Python
Usage
You just import the package, and call log.
^{pr 1}$That's not interesting, lets compose a simple prefix in front of the message.
^{pr 2}$You can also chain the logging modifiers
^{pr 3}$There are also a bunch of built in formatters, and colors. Colors are based on the ^{
Or you can call some premade logs
^{pr 5}$You can event also change the text of premade logs!
^{pr 6}$Log Object
A log object has the following attributes:
- Message
- IPrefix
- ISuffix
And the following functions:
- Template
- Prefix
- Suffix
How the attributes work
^{pr 7}$The template function lets you load specific settings for your log
^{pr 8}$The ^{
Format
Format attributes:
- Time :: The current time
- Date :: The current date
- FullDate :: The current date and time
- Platform :: All info about the OS
- System :: The OS
- Release :: The release of the OS
- Version :: The version of the OS
Example use of the attribues:
^{pr 9}$You can also use the Formats ^{
Colors
- Reset
- End (Same as Reset)
- White
- LightGray
- Gray
- Black
- Red
- LightRed
- Blue
- LightBlue
- Green
- LightGreen
- Yellow
- LightYellow
- Purple
- LightPurple
- Cyan
Premade Logs
- Debug :: ^{
} >> The Prefix is LightPurple - Warning :: ^{
} >> The Prefix is LightYellow - Error :: ^{
} >> The Prefix is LightRed - Success :: ^{
} >> The Prefix is LightGreen - Server :: ^{
} >> The prefix is LightBlue