# README
logs

全新的 v4 版本,对所有功能进行了重构,与之前的几个版本完全不同。 新版本不再追求与标准库的绝对兼容,仅提供了 StdLogger 用于转换成标准库对象的方法。
import "github.com/issue9/logs/v4"
l := logs.New(nil)
l.Debug("debug start...")
l.Debugf("%v start...", "debug")
l.DEBUG().Print("debug start...")
err := l.With(logs.LevelError, map[string]interface{}{"k1":"v1"})
err.Printf("带默认参数 k1=v1") // 不用 With 指定 k1,err 全都自动带上此参数
安装
go get github.com/issue9/logs/v4
版权
# Packages
Package writers 提供了一组实现 io.Writer 接口的结构.
# Functions
Caller 是否显示记录的定位信息.
Created 是否显示记录的创建时间.
No description provided by the author
No description provided by the author
MergeWriter 将多个 Writer 合并成一个 Writer 接口对象.
New 声明 Logs 对象
w 如果为 nil,则表示采用 [NewNopWriter]。.
NewDispatchWriter 根据 Level 派发到不同的 Writer 对象.
NewJSONWriter 声明 JSON 格式的输出.
NewNopWriter 空的 Writer 接口实现.
NewTermWriter 带颜色的终端输出通道
timeLayout 表示输出的时间格式,遵守 time.Format 的参数要求, 如果为空,则不输出时间信息; fore 表示终端信息的字符颜色,背景始终是默认色; w 表示终端的接口,可以是 [os.Stderr] 或是 [os.Stdout], 如果是其它的实现者则会带控制字符一起输出;.
No description provided by the author
No description provided by the author
Print 自定义 [Printer] 接口.
# Constants
目前支持的日志类型.
目前支持的日志类型.
目前支持的日志类型.
目前支持的日志类型.
目前支持的日志类型.
目前支持的日志类型.
No description provided by the author
No description provided by the author
No description provided by the author
# Type aliases
No description provided by the author
No description provided by the author
No description provided by the author