package
0.0.0-20190422025920-beccf3fe4313
Repository: https://github.com/changwh/go-common.git
Documentation: pkg.go.dev
# README
log
项目简介
日志基础库
编译环境
请只用golang v1.7.x以上版本编译执行。
依赖包
1.公共包go-common
# Functions
Close close resource.
Error logs a message at the error log level.
Errorv logs a message at the error log level.
Errorw logs a message with some additional context.
Info logs a message at the info log level.
Infov logs a message at the info log level.
Infow logs a message with some additional context.
Init create logger with context.
KV return a log kv for logging field.
NewAgent a Agent.
NewFile crete a file logger.
NewStdout create a stdout log handler.
SetFormat only effective on stdout and file handler %T time format at "15:04:05.999" on stdout handler, "15:04:05 MST" on file handler %t time format at "15:04:05" on stdout handler, "15:04" on file on file handler %D data format at "2006/01/02" %d data format at "01/02" %L log level e.g.
V reports whether verbosity at the call site is at least the requested level.
Warn logs a message at the warning log level.
Warnv logs a message at the warning log level.
Warnw logs a message with some additional context.
# Structs
AgentConfig agent config.
AgentHandler agent struct.
Config log config.
D represents a map of entry level data used for structured logging.
FileHandler .
Handlers a bundle for hander with filter function.
StdoutHandler stdout log handler.