Documentation
¶
Index ¶
- func InitLogger()
- type LoggerInterface
- type ZapLogger
- func (zl *ZapLogger) Debug(ctx context.Context, msg string, fields ...zap.Field)
- func (zl *ZapLogger) Error(ctx context.Context, msg string, fields ...zap.Field)
- func (zl *ZapLogger) Fatal(ctx context.Context, msg string, fields ...zap.Field)
- func (zl *ZapLogger) Flush()
- func (zl *ZapLogger) Info(ctx context.Context, msg string, fields ...zap.Field)
- func (zl *ZapLogger) InitLogger()
- func (zl *ZapLogger) Result(ctx context.Context, msg string, fields ...zap.Field)
- func (zl *ZapLogger) SetLogLevel(level string)
- func (zl *ZapLogger) Warn(ctx context.Context, msg string, fields ...zap.Field)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LoggerInterface ¶
type LoggerInterface interface { InitLogger() Debug(ctx context.Context, msg string, fields ...zap.Field) Info(ctx context.Context, msg string, fields ...zap.Field) Result(ctx context.Context, msg string, fields ...zap.Field) Warn(ctx context.Context, msg string, fields ...zap.Field) Error(ctx context.Context, msg string, fields ...zap.Field) Fatal(ctx context.Context, msg string, fields ...zap.Field) SetLogLevel(level string) Flush() }
LoggerInterface defines the methods for a logger
type ZapLogger ¶
type ZapLogger struct {
// contains filtered or unexported fields
}
ZapLogger is the implementation of LoggerInterface using zap
func (*ZapLogger) InitLogger ¶
func (zl *ZapLogger) InitLogger()
InitLogger initializes the logger with optional file logging
func (*ZapLogger) SetLogLevel ¶
SetLogLevel dynamically sets the log level
Click to show internal directories.
Click to hide internal directories.