代码拉取完成,页面将自动刷新
package g2cache
import (
"log"
)
// 外部调用者可实现此日志接口用于将日志导出
type LoggerInterface interface {
LogInfoF(f string, s ...interface{})
LogInfo(s ...interface{})
LogDebug(s ...interface{})
LogDebugF(f string, s ...interface{})
LogErr(s ...interface{})
LogErrF(f string, s ...interface{})
}
func LogInfoF(f string, s ...interface{}) {
Logger.LogInfoF(f, s)
}
func LogInfo(s ...interface{}) {
Logger.LogInfo(s)
}
func LogDebug(s ...interface{}) {
Logger.LogDebug(s)
}
func LogDebugF(f string, s ...interface{}) {
Logger.LogDebugF(f, s)
}
func LogErr(s ...interface{}) {
Logger.LogErr(s)
}
func LogErrF(f string, s ...interface{}) {
Logger.LogErrF(f, s)
}
type sysLogger struct{}
var (
Logger LoggerInterface = &sysLogger{}
)
func (l *sysLogger) LogInfo(s ...interface{}) {
log.Println("[\u001B[32mg2cache\u001B[0m] [\u001B[32minfo\u001B[0m] ", s)
}
func (l *sysLogger) LogInfoF(f string, s ...interface{}) {
log.Printf("[\u001B[32mg2cache\u001B[0m] [\u001B[32minfo\u001B[0m] "+f, s)
}
func (l *sysLogger) LogDebug(s ...interface{}) {
log.Println("[\u001B[32mg2cache\u001B[0m] [\u001B[33mdebug\u001B[0m] ", s)
}
func (l *sysLogger) LogDebugF(f string, s ...interface{}) {
log.Printf("[\u001B[32mg2cache\u001B[0m] [\u001B[33mdebug\u001B[0m] "+f, s)
}
func (l *sysLogger) LogErr(s ...interface{}) {
log.Println("[\u001B[32mg2cache\u001B[0m] [\u001B[31merr\u001B[0m] ", s)
}
func (l *sysLogger) LogErrF(f string, s ...interface{}) {
log.Printf("[\u001B[32mg2cache\u001B[0m] [\u001B[31merr\u001B[0m] "+f, s)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。