Documentation ¶
Index ¶
- Constants
- func Close()
- func CtxAddKv(ctx context.Context, v ...interface{}) context.Context
- func CtxDebugf(ctx context.Context, format string, args ...interface{})
- func CtxErrorf(ctx context.Context, format string, args ...interface{})
- func CtxFatalf(ctx context.Context, format string, args ...interface{})
- func CtxInfof(ctx context.Context, format string, args ...interface{})
- func CtxPanicf(ctx context.Context, format string, args ...interface{})
- func CtxWarnf(ctx context.Context, format string, args ...interface{})
- func Debug(ctx context.Context, msg string, fields ...zap.Field)
- func Debugf(format string, args ...interface{})
- func EnableAsyncLog()
- func Error(ctx context.Context, msg string, fields ...zap.Field)
- func Errorf(format string, args ...interface{})
- func Fatalf(format string, args ...interface{})
- func GetLocalIP() string
- func Info(ctx context.Context, msg string, fields ...zap.Field)
- func Infof(format string, args ...interface{})
- func NewChildSpan(ctx context.Context) context.Context
- func NewCore(enc zapcore.Encoder, ws zapcore.WriteSyncer, enab zapcore.LevelEnabler) *asyncCore
- func Panic(ctx context.Context, msg string, fields ...zap.Field)
- func Panicf(format string, args ...interface{})
- func Pb(key string, pbMsg proto.Message) zap.Field
- func Start(logPath string)
- func StartWithConfig(config *Config)
- func StartWithLevel(logPath string, level zapcore.Level)
- func Warn(ctx context.Context, msg string, fields ...zap.Field)
- func Warnf(format string, args ...interface{})
- func WithField(f ...zapcore.Field)
- func WithSpan(ctx context.Context) context.Context
- type Config
- type SampleLogger
- type Span
Constants ¶
View Source
const ( BatchSize = 100 * 1024 Frequency = 1 * time.Second )
View Source
const (
SpanKey = "span"
)
Variables ¶
This section is empty.
Functions ¶
func EnableAsyncLog ¶
func EnableAsyncLog()
func NewCore ¶
func NewCore(enc zapcore.Encoder, ws zapcore.WriteSyncer, enab zapcore.LevelEnabler) *asyncCore
NewCore creates a Core that writes logs to a WriteSyncer.
func StartWithConfig ¶
func StartWithConfig(config *Config)
func StartWithLevel ¶
Types ¶
type SampleLogger ¶
type SampleLogger struct {
// contains filtered or unexported fields
}
func NewSampleLogger ¶
func NewSampleLogger(config *Config) *SampleLogger
Click to show internal directories.
Click to hide internal directories.