Documentation ¶
Index ¶
- func Any(key string, val interface{}) zapcore.Field
- func Debug(msg string, f ...zap.Field)
- func Err(err error) zapcore.Field
- func Error(msg string, f ...zap.Field)
- func Fatal(msg string, f ...zap.Field)
- func Info(msg string, f ...zap.Field)
- func Init(ctx context.Context, debug bool) error
- func Logger() *zap.Logger
- func NewForTest() (*zap.Logger, *observer.ObservedLogs)
- func Panic(msg string, f ...zap.Field)
- func String(key, val string) zapcore.Field
- func Time(key string, val time.Time) zapcore.Field
- func With(f ...zap.Field) *zap.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶ added in v0.1.1
Debug logs a message at DebugLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
func Error ¶ added in v0.1.1
Error logs a message at ErrorLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
func Fatal ¶ added in v0.1.1
Fatal logs a message at FatalLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
The logger then calls os.Exit(1), even if logging at FatalLevel is disabled.
func Info ¶ added in v0.1.1
Info logs a message at InfoLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
func Init ¶ added in v0.1.1
Init initialize logger, if debug set to true zap.NewDevelopment will use to create a zap logger otherwise zap.NewProduction will use
func NewForTest ¶
func NewForTest() (*zap.Logger, *observer.ObservedLogs)
NewForTest returns a new logger and the corresponding observed logs which can be used in unit tests to verify log entries.
func Panic ¶ added in v0.1.1
Panic logs a message at PanicLevel. The message includes any fields passed at the log site, as well as any fields accumulated on the logger.
The logger then panics, even if logging at PanicLevel is disabled.
Types ¶
This section is empty.