代码拉取完成,页面将自动刷新
package mylog
import "fmt"
type Color int
// 定义字体 颜色
const (
FgBlack Color = iota + 30
FgRed
FgGreen
FgYellow
FgMagenta
FgCyan
FgWhite
)
const (
ShowStyleDefault uint = 0 //终端默认设置
ShowStyleHighLight uint = 1 //高亮显示
ShowStyleUunderline uint = 4 //使用下划线
ShowStyleFlashing uint = 5 //闪烁
ShowStyleAntiWhite uint = 7 //反白显示
ShowStyleInvisible uint = 8 //不可见
)
func showStyle(showStyle uint, fgColor, bgColor Color, content string) string {
return fmt.Sprintf("\033[%d;%d;%dm%s\033[0m", showStyle, fgColor, bgColor, content)
}
func debugStyle(content string) string {
return showStyle(ShowStyleHighLight, 33, 40, content)
}
func infoStyle(content string) string {
return showStyle(ShowStyleHighLight, 32, 40, content)
}
func warnStyle(content string) string {
return showStyle(ShowStyleHighLight, 34, 40, content)
}
func errorStyle(content string) string {
return showStyle(ShowStyleHighLight, 31, 40, content)
}
func panicStyle(content string) string {
return showStyle(ShowStyleHighLight, 35, 40, content)
}
func fatalStyle(content string) string {
return showStyle(ShowStyleHighLight, 37, 40, content)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。