Documentation ¶
Index ¶
Examples ¶
Constants ¶
View Source
const ( // DebugLevel logs are typically voluminous, and are usually disabled in production. DebugLevel = zapcore.DebugLevel // InfoLevel is the default logging priority. InfoLevel = zapcore.InfoLevel // WarnLevel logs are more important than Info, but don't need individual human review. WarnLevel = zapcore.WarnLevel // ErrorLevel logs are high-priority. If an application is running smoothly, // it shouldn't generate any error-level logs. ErrorLevel = zapcore.ErrorLevel //FatalLevel logs a message, then calls os.Exit(1). FatalLevel = zapcore.FatalLevel )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldLogger ¶
type Helper ¶
type Helper interface {
WithContext(ctx context.Context) (logger FieldLogger)
}
Helper logger helper
func NewHelper ¶
Example ¶
var logger, err = zaplog.NewZapLogger(&config.ZapConfig{}) if err != nil { stdLog.Fatal("err ", err) } var helper Helper = NewHelper(logger) helper.WithContext(context.Background()).Info("hello") helper.WithContext(context.TODO()).Error("error ", zap.String("error", "error info"))
Output:
type LevelHooks ¶
type ZapHelperBuilder ¶
type ZapHelperBuilder struct {
// contains filtered or unexported fields
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.