1 Star 0 Fork 0

trako / gutils

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
color.go 691 Bytes
一键复制 编辑 原始数据 按行查看 历史
trako 提交于 2023-08-31 17:03 . add glog
package glog
type brush func(string) string
func newBrush(color string) brush {
pre := "\033["
reset := "\033[0m"
return func(text string) string {
return pre + color + "m" + text + reset
}
}
// 字体颜色:30:黑 31:红 32:绿 33:黄 34:蓝色 35:紫色 36:深绿 37:白色
// 背景:40:黑 41:深红 42:绿 43:黄色 44:蓝色 45:紫色 46:深绿 47:白色
var colors = []brush{
newBrush("1;37"), // Debug 白色
newBrush("1;37"), // Debug 白色
newBrush("1;36"), // Info 天蓝色
newBrush("1;33"), // Warn 黄色
newBrush("1;31"), // Error 红色
newBrush("1;41"), // Fatal 红色底
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/trako/gutils.git
git@gitee.com:trako/gutils.git
trako
gutils
gutils
v0.0.2

搜索帮助

344bd9b3 5694891 D2dac590 5694891