Documentation
¶
Index ¶
- func SetGlobalLogger(l Logger) error
- func Sync() error
- type Logger
- type ZapLogger
- func (z *ZapLogger) Debug(msg string, keysAndValues ...any)
- func (z *ZapLogger) Error(msg string, keysAndValues ...any)
- func (z *ZapLogger) Fatal(msg string, keysAndValues ...any)
- func (z *ZapLogger) Info(msg string, keysAndValues ...any)
- func (z *ZapLogger) Inner() *zap.SugaredLogger
- func (z *ZapLogger) Warn(msg string, keysAndValues ...any)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SetGlobalLogger ¶
SetGlobalLogger sets the global logger instance. It should be called once during application initialization.
Types ¶
type Logger ¶
type Logger interface {
Debug(msg string, keysAndValues ...any)
Info(msg string, keysAndValues ...any)
Warn(msg string, keysAndValues ...any)
Error(msg string, keysAndValues ...any)
Fatal(msg string, keysAndValues ...any)
}
Logger is the interface that wraps basic logging methods.
func CreateLogger ¶
CreateLogger creates logger instances based on the configuration.
func G ¶
func G() Logger
G retrieves the global logger instance. Returns a no-op logger if no global logger is set.
func InitializeGlobalLogger ¶
InitializeGlobalLogger initializes the global logger based on the provided configuration. It should be called once during application startup.
func NewNoOpLogger ¶
func NewNoOpLogger() Logger
NewNoOpLogger creates a new instance of noOpLogger.
type ZapLogger ¶
type ZapLogger struct {
// contains filtered or unexported fields
}
ZapLogger is an implementation of Logger using Uber's Zap.
func NewZapLogger ¶
NewZapLogger creates a new ZapLogger based on the provided configuration.
func (*ZapLogger) Inner ¶
func (z *ZapLogger) Inner() *zap.SugaredLogger