Documentation
¶
Index ¶
Constants ¶
View Source
const ( KeyTraceID = "trace_id" KeyRequestID = "request_id" KeyErrorID = "error_id" )
Variables ¶
This section is empty.
Functions ¶
func GetZapFieldsForError ¶
func GetZapFieldsFromContext ¶
GetZapFieldsFromContext - Gets any useful zap fields from context TODO: Explore if ctxzap is a better option
Types ¶
type LoggerOption ¶
type LoggerOption func(z *ZapLogger)
func WithAsyncFlush ¶
func WithAsyncFlush(duration time.Duration) LoggerOption
func WithEncoderFunc ¶
func WithEncoderFunc(f func(cfg zapcore.EncoderConfig) zapcore.Encoder) LoggerOption
func WithKitLogger ¶
func WithKitLogger(logger log.Logger) LoggerOption
func WithZapLogger ¶
func WithZapLogger(logger *zap.Logger) LoggerOption
type ZapLogger ¶
type ZapLogger struct {
// contains filtered or unexported fields
}
ZapLogger is go-kit and zap compatible logger
func NewAsyncZapLogger
deprecated
func NewAsyncZapLogger(atom zap.AtomicLevel, asyncFlushIntervalMs int, loggerOpts ...LoggerOption) *ZapLogger
NewAsyncZapLogger sets up a async zap global logger and returns gokit compatible logger
Deprecated: Use NewZapLogger with WithAsyncFlush instead.
func NewZapLogger ¶
func NewZapLogger(atom zap.AtomicLevel, loggerOpts ...LoggerOption) *ZapLogger
NewZapLogger sets up a zap global logger and returns gokit compatible logger
func (*ZapLogger) GetKitLogger ¶
GetKitLogger - return gokit compatible logger
func (*ZapLogger) GetZapLogger ¶
GetZapLogger - return zap logger
func (*ZapLogger) S ¶
func (z *ZapLogger) S() *zap.SugaredLogger
S - Zap compatible sugared-logger function
Click to show internal directories.
Click to hide internal directories.