Categorygithub.com/issue9/logs/v4
modulepackage
4.5.1
Repository: https://github.com/issue9/logs.git
Documentation: pkg.go.dev

# README

logs Go PkgGoDev Go version codecov

全新的 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

版权

本项目采用 MIT 开源授权许可证,完整的授权说明可在 LICENSE 文件中找到。

# 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

# Structs

Entry
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author
No description provided by the author
Printer 对 [Input] 输入的内容进行二次处理 每个函数分别对 [Input] 相应的输入方法,对其提供的内容进行格式化。.
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