Documentation ¶
Index ¶
- Constants
- func StdLoggerWithLevel(adapter Logger, level Level, withFields ...Field) *log.Logger
- func ToContext(ctx context.Context, kvs ...Field) context.Context
- type Adapter
- func (a *Adapter) Config() Config
- func (a *Adapter) Debug(ctx context.Context, message any, fields ...Field)
- func (a *Adapter) Enabled(level Level) bool
- func (a *Adapter) Error(ctx context.Context, message any, fields ...Field)
- func (a *Adapter) Fatal(ctx context.Context, message any, fields ...Field)
- func (a *Adapter) Info(ctx context.Context, message any, fields ...Field)
- func (a *Adapter) Log(ctx context.Context, level Level, message any, fields ...Field)
- func (a *Adapter) SetLevel(level Level)
- func (a *Adapter) Sync() error
- func (a *Adapter) Warn(ctx context.Context, message any, fields ...Field)
- type Config
- type Field
- func Any(key string, value any) Field
- func Bool(key string, value bool) Field
- func ByteString(key string, value []byte) Field
- func ContextLogValues(ctx context.Context) []Field
- func Int(key string, value int) Field
- func Int32(key string, value int32) Field
- func Int64(key string, value int64) Field
- func String(key string, value string) Field
- type Level
- type Logger
- type Option
- type SamplingConfig
Constants ¶
View Source
const ( FatalLevel = zap.FatalLevel ErrorLevel = zap.ErrorLevel WarnLevel = zap.WarnLevel InfoLevel = zap.InfoLevel DebugLevel = zap.DebugLevel )
Variables ¶
This section is empty.
Functions ¶
func StdLoggerWithLevel ¶
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
func NewFromConfig ¶
type Config ¶
type Config struct { IsInDevMode bool OutputPaths []string Sampling *SamplingConfig Hooks []func(entry zapcore.Entry) error InitialLevel Level }
func DefaultConfig ¶
func DefaultConfig() *Config
type Option ¶
type Option func(cfg *Config)
func WithDevelopmentMode ¶
func WithDevelopmentMode() Option
func WithFileOutput ¶
type SamplingConfig ¶
type SamplingConfig = zap.SamplingConfig
Source Files ¶
Click to show internal directories.
Click to hide internal directories.