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 ¶
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 ¶
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 ¶
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 ¶
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 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 ¶
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.