Documentation ¶
Index ¶
- func Deref[T any](p *T, defaultValue T) T
- func InitGLogger(options ...loggerOption)
- func NewContextWithLogger(ctx context.Context, logger Logger) context.Context
- func ToPointer[T any](v T) *T
- type Logger
- type LoggerFormat
- type LoggerFormatOption
- type LoggerLevel
- type LoggerLevelOption
- type LoggerStdImpl
- func (l *LoggerStdImpl) Begin(name string, msg string, keysAndValues ...interface{}) func(msg string, keysAndValues ...interface{})
- func (l *LoggerStdImpl) Debug(msg string, keysAndValues ...interface{})
- func (l *LoggerStdImpl) Enabled() bool
- func (l *LoggerStdImpl) Error(err error, msg string, keysAndValues ...interface{})
- func (l *LoggerStdImpl) Info(msg string, keysAndValues ...interface{})
- func (l *LoggerStdImpl) Warn(err error, msg string, keysAndValues ...interface{})
- func (l *LoggerStdImpl) WithCallDepth(depth int) Logger
- func (l *LoggerStdImpl) WithName(name string) Logger
- func (l *LoggerStdImpl) WithValues(keysAndValues ...interface{}) Logger
- type LoggerZapImpl
- func (l *LoggerZapImpl) Begin(name string, msg string, keysAndValues ...interface{}) func(msg string, keysAndValues ...interface{})
- func (l *LoggerZapImpl) Debug(msg string, keysAndValues ...interface{})
- func (l *LoggerZapImpl) Enabled() bool
- func (l *LoggerZapImpl) Error(err error, msg string, keysAndValues ...interface{})
- func (l *LoggerZapImpl) Info(msg string, keysAndValues ...interface{})
- func (l *LoggerZapImpl) Warn(err error, msg string, keysAndValues ...interface{})
- func (l *LoggerZapImpl) WithCallDepth(depth int) Logger
- func (l *LoggerZapImpl) WithName(name string) Logger
- func (l *LoggerZapImpl) WithValues(keysAndValues ...interface{}) Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitGLogger ¶
func InitGLogger(options ...loggerOption)
func NewContextWithLogger ¶
Types ¶
type Logger ¶
type Logger interface { Enabled() bool WithValues(keysAndValues ...interface{}) Logger Debug(msg string, keysAndValues ...interface{}) Info(msg string, keysAndValues ...interface{}) Warn(err error, msg string, keysAndValues ...interface{}) Error(err error, msg string, keysAndValues ...interface{}) WithCallDepth(depth int) Logger WithName(name string) Logger Begin(name string, msg string, keysAndValues ...interface{}) func(msg string, keysAndValues ...interface{}) }
func FromContext ¶
func NewLoggerStdImplWithOption ¶
func NewLoggerStdImplWithOption() Logger
type LoggerFormat ¶
type LoggerFormat int
const ( LoggerFormatJSON LoggerFormat = iota LoggerFormatConsole )
func ParseLoggerFormatStr ¶
func ParseLoggerFormatStr(v string) LoggerFormat
func (LoggerFormat) String ¶
func (f LoggerFormat) String() string
type LoggerFormatOption ¶
type LoggerFormatOption int
func OptionLoggerFormat ¶
func OptionLoggerFormat(v LoggerFormat) LoggerFormatOption
type LoggerLevel ¶
type LoggerLevel int
const ( LoggerLevelDebug LoggerLevel = iota - 1 LoggerLevelInfo LoggerLevelWarn LoggerLevelError )
func ParseLoggerLevelStr ¶
func ParseLoggerLevelStr(v string) LoggerLevel
func (LoggerLevel) String ¶
func (l LoggerLevel) String() string
type LoggerLevelOption ¶
type LoggerLevelOption int
func OptionLoggerLevel ¶
func OptionLoggerLevel(v LoggerLevel) LoggerLevelOption
type LoggerStdImpl ¶
type LoggerStdImpl struct {
// contains filtered or unexported fields
}
func (*LoggerStdImpl) Begin ¶
func (l *LoggerStdImpl) Begin(name string, msg string, keysAndValues ...interface{}) func(msg string, keysAndValues ...interface{})
func (*LoggerStdImpl) Debug ¶
func (l *LoggerStdImpl) Debug(msg string, keysAndValues ...interface{})
func (*LoggerStdImpl) Enabled ¶
func (l *LoggerStdImpl) Enabled() bool
func (*LoggerStdImpl) Error ¶
func (l *LoggerStdImpl) Error(err error, msg string, keysAndValues ...interface{})
func (*LoggerStdImpl) Info ¶
func (l *LoggerStdImpl) Info(msg string, keysAndValues ...interface{})
func (*LoggerStdImpl) Warn ¶
func (l *LoggerStdImpl) Warn(err error, msg string, keysAndValues ...interface{})
func (*LoggerStdImpl) WithCallDepth ¶
func (l *LoggerStdImpl) WithCallDepth(depth int) Logger
func (*LoggerStdImpl) WithName ¶
func (l *LoggerStdImpl) WithName(name string) Logger
func (*LoggerStdImpl) WithValues ¶
func (l *LoggerStdImpl) WithValues(keysAndValues ...interface{}) Logger
type LoggerZapImpl ¶
type LoggerZapImpl struct {
// contains filtered or unexported fields
}
func (*LoggerZapImpl) Begin ¶
func (l *LoggerZapImpl) Begin(name string, msg string, keysAndValues ...interface{}) func(msg string, keysAndValues ...interface{})
func (*LoggerZapImpl) Debug ¶
func (l *LoggerZapImpl) Debug(msg string, keysAndValues ...interface{})
func (*LoggerZapImpl) Enabled ¶
func (l *LoggerZapImpl) Enabled() bool
func (*LoggerZapImpl) Error ¶
func (l *LoggerZapImpl) Error(err error, msg string, keysAndValues ...interface{})
func (*LoggerZapImpl) Info ¶
func (l *LoggerZapImpl) Info(msg string, keysAndValues ...interface{})
func (*LoggerZapImpl) Warn ¶
func (l *LoggerZapImpl) Warn(err error, msg string, keysAndValues ...interface{})
func (*LoggerZapImpl) WithCallDepth ¶
func (l *LoggerZapImpl) WithCallDepth(depth int) Logger
func (*LoggerZapImpl) WithName ¶
func (l *LoggerZapImpl) WithName(name string) Logger
func (*LoggerZapImpl) WithValues ¶
func (l *LoggerZapImpl) WithValues(keysAndValues ...interface{}) Logger
Click to show internal directories.
Click to hide internal directories.