Documentation ¶
Index ¶
- type Logger
- func (l *Logger) Debug(args ...interface{})
- func (l *Logger) Debugf(format string, args ...interface{})
- func (l *Logger) Debugln(args ...interface{})
- func (l *Logger) Error(args ...interface{})
- func (l *Logger) Errorf(format string, args ...interface{})
- func (l *Logger) Errorln(args ...interface{})
- func (l *Logger) Fatal(args ...interface{})
- func (l *Logger) Fatalf(format string, args ...interface{})
- func (l *Logger) Fatalln(args ...interface{})
- func (l *Logger) Info(args ...interface{})
- func (l *Logger) Infof(format string, args ...interface{})
- func (l *Logger) Infoln(args ...interface{})
- func (l *Logger) Warn(args ...interface{})
- func (l *Logger) Warnf(format string, args ...interface{})
- func (l *Logger) Warnln(args ...interface{})
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
*zap.SugaredLogger
}
Logger is a zap logger adapter that implements logger interface.
func New ¶
func New(sugaredLogger *zap.SugaredLogger) *Logger
New returns a logger.
Example ¶
zapLogger, err := zap.NewDevelopment(zap.AddCallerSkip(1)) if err != nil { panic(err) } logger := New(zapLogger.Sugar()) logger.Debug("debug") logger.Debugf("debugf") logger.Debugln("debugln") logger.Info("info") logger.Infof("infof") logger.Infoln("infoln") logger.Warn("warn") logger.Warnf("warnf") logger.Warnln("warnln") logger.Error("error") logger.Errorf("errorf") logger.Errorln("errorln") //logger.Fatal("fatal") //logger.Fatalf("fatalf") //logger.Fatalln("fatalln")
Output:
func (*Logger) Debugln ¶
func (l *Logger) Debugln(args ...interface{})
Debugln implements Logger.Debugln.
func (*Logger) Errorln ¶
func (l *Logger) Errorln(args ...interface{})
Errorln implements Logger.Errorln.
func (*Logger) Fatalln ¶
func (l *Logger) Fatalln(args ...interface{})
Fatalln implements Logger.Fatalln.
func (*Logger) Infoln ¶
func (l *Logger) Infoln(args ...interface{})
Infoln implements Logger.Infoln.
Click to show internal directories.
Click to hide internal directories.