goProject/trunk/goutil/logUtil/impl-localfile/api.go
皮蛋13361098506 1b77f62820 初始化项目
2025-01-06 16:01:02 +08:00

36 lines
792 B
Go

package impl_localfile
import "sync"
func (l *Logger) InfoLog(format string, args ...interface{}) {
l.log(getLog(format, args...), info, true)
}
func (l *Logger) WarnLog(format string, args ...interface{}) {
l.log(getLog(format, args...), warn, true)
}
func (l *Logger) DebugLog(format string, args ...interface{}) {
l.log(getLog(format, args...), debug, true)
}
func (l *Logger) ErrorLog(format string, args ...interface{}) {
l.log(getLog(format, args...), _error, true)
}
func (l *Logger) FatalLog(format string, args ...interface{}) {
l.log(getLog(format, args...), fatal, true)
}
func (l *Logger) CloseLog(waitFinish bool) {
wg := sync.WaitGroup{}
// 关闭所有的file
for _, logger := range l.loggerMap {
wg.Add(1)
go logger.Close(&wg, waitFinish)
}
wg.Wait()
}