1 Star 1 Fork 1

menuiis/logx

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 791 Bytes
一键复制 编辑 原始数据 按行查看 历史
menuis 提交于 2023-09-16 12:59 . init
package main
import (
"gitee.com/menciis/logx"
)
func main() {
// First argument is the raw text for outputs
// second argument is the color code
// and the last, variadic argument can be any `kataras/pio.RichOption`, e.g. pio.Background, pio.Underline.
// Default is "[ERRO]"
logx.ErrorText("|ERROR|", 31)
// Default is "[WARN]"
logx.WarnText("|WARN|", 32)
// Default is "[INFO]"
logx.InfoText("|INFO|", 34)
// Default is "[DBUG]"
logx.DebugText("|DEBUG|", 33)
// Business as usual...
logx.SetLevel("debug")
logx.Println("This is a raw message, no levels, no colors.")
logx.Info("This is an info message, with colors (if the output is terminal)")
logx.Warn("This is a warning message")
logx.Error("This is an error message")
logx.Debug("This is a debug message")
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/menciis/logx.git
git@gitee.com:menciis/logx.git
menciis
logx
logx
master

搜索帮助