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 ^{} module, so you can use their api of chaining properties.

^{pr 4}$

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 ^{} and ^{} function appends a new prefix or suffix to the current logs prefix or suffix.

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 ^{} function

^{pr 10}$

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

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用prepared语句在oracle中插入日期   对点具有双重值的java   使用多个通配符的java请求映射   java Springboot为什么要设置springbootstartertomcat   除了对JavaBean的请求之外,还使用servletContext的servlet   java如何清除OCSID。返回到池的连接时的CLIENTID JDBC客户端信息属性   将整型数组转换为光栅Java   java使用对象引用作为互斥锁   java为什么在编程语言中使用sin函数返回奇怪的sin值不像计算器   java如何将JButton链接到对象并调用相关方法   php用Java发送POST数据   导航属性的java模拟加载   java多个活动错误Android试图对空对象引用调用虚拟方法“”   java Android更改ActionBar文本颜色   如何使用带有java反射且不带开关的parant引用创建子类