1 Star 1 Fork 1

menuiis/logx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.go 989 Bytes
一键复制 编辑 原始数据 按行查看 历史
menuis 提交于 1年前 . init
package main
import (
"gitee.com/menciis/logx"
)
func main() {
// Default Output is `os.Stdout`,
// but you can change it:
// golog.SetOutput(os.Stderr)
// Time Format defaults to: "2006/01/02 15:04"
// you can change it to something else or disable it with:
log := logx.New()
log.MessageColor = true
log.TimeColor = true
logx.SetTimeFormat("")
// Level defaults to "info",
// but you can change it:
//logx.SetLevel("debug")
log.Println("This is a raw message, no levels, no colors.")
logx.Verbose("This is a verbose message, it will be printed if logger's Level is <= VerboseLevel")
logx.Debug("This is a debug message")
log.Info("This is an info message, with colors (if the output is terminal)")
log.Warn("This is a warning message")
logx.Error("This is an error message")
logx.Silentf("This is a silent message, it will not be printed")
logx.Fatal("Fatal will exit no matter what, but it will also print the log message if logger's Level is >= FatalLevel")
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/menciis/logx.git
git@gitee.com:menciis/logx.git
menciis
logx
logx
master

搜索帮助