aides-repo-api/internal/logger/logger.go

27 lines
532 B
Go
Raw Normal View History

2024-12-15 08:39:18 +00:00
package logger
import (
"sync"
)
var (
instance *ZapLogger
once sync.Once
)
// Logger определяет интерфейс для логгера
type Logger interface {
Debug(msg string, fields map[string]interface{})
Info(msg string, fields map[string]interface{})
Warn(msg string, fields map[string]interface{})
Error(msg string, fields map[string]interface{})
Fatal(msg string, fields map[string]interface{})
}
func GetLogger() *ZapLogger {
once.Do(func() {
instance = NewZapLogger()
})
return instance
}