Documentation ¶
Overview ¶
Package logger holds the mostly used logger instance `GlobalLogger`
Index ¶
- func Debug(msg string, fields ...zap.Field)
- func Debugf(template string, args ...interface{})
- func Error(msg string, fields ...zap.Field)
- func Errorf(template string, args ...interface{})
- func Fatal(msg string, fields ...zap.Field)
- func Fatalf(template string, args ...interface{})
- func Info(msg string, fields ...zap.Field)
- func Infof(template string, args ...interface{})
- func Panic(msg string, fields ...zap.Field)
- func Panicf(template string, args ...interface{})
- func SetLogger(instance *zap.Logger)
- func Sync() error
- func Warn(msg string, fields ...zap.Field)
- func Warnf(template string, args ...interface{})
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 Debugf ¶
func Debugf(template string, args ...interface{})
Debugf wraps Debugf of sugared logger, it uses fmt.Sprintf to log a templated message.
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 Errorf ¶
func Errorf(template string, args ...interface{})
Errorf wraps Errorf of sugared logger, it uses fmt.Sprintf to log a templated message.
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 Fatalf ¶
func Fatalf(template string, args ...interface{})
Fatalf wraps Fatalf of sugared logger, it uses fmt.Sprintf to log a templated message. Other behaviors are similar to Fatal.
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 Infof ¶
func Infof(template string, args ...interface{})
Infof wraps Infof of sugared logger, it uses fmt.Sprintf to log a templated message.
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.
func Panicf ¶
func Panicf(template string, args ...interface{})
Panicf wraps Panicf of sugared logger, it uses fmt.Sprintf to log a templated message. Other behaviors are similar to Panic.
func SetLogger ¶
SetLogger inject a logger instance. It is not strictly thread-safe. So there may still have logs output to the old logger within a short time.
func Sync ¶
func Sync() error
Sync calls the underlying Core's Sync method, flushing any buffered log entries. Applications should take care to call Sync before exiting.
Types ¶
This section is empty.