forked from TrueCloudLab/frostfs-http-gw
*: fix all comment-related golint warnings
Some of this code is going to be moved to SDK library, so it's important. Signed-off-by: Roman Khimov <roman@nspcc.ru>
This commit is contained in:
parent
3173c70eb6
commit
df3c87af79
14 changed files with 88 additions and 4 deletions
|
@ -12,12 +12,15 @@ type (
|
|||
log *zap.SugaredLogger
|
||||
}
|
||||
|
||||
// Logger includes grpclog.LoggerV2 interface with an additional
|
||||
// Println method.
|
||||
Logger interface {
|
||||
grpclog.LoggerV2
|
||||
Println(v ...interface{})
|
||||
}
|
||||
)
|
||||
|
||||
// GRPC wraps given zap.Logger into grpclog.LoggerV2+ interface.
|
||||
func GRPC(l *zap.Logger) Logger {
|
||||
log := l.WithOptions(
|
||||
// skip gRPCLog + zapLogger in caller
|
||||
|
@ -29,32 +32,47 @@ func GRPC(l *zap.Logger) Logger {
|
|||
}
|
||||
}
|
||||
|
||||
// Info implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) Info(args ...interface{}) { z.log.Info(args...) }
|
||||
|
||||
// Infoln implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) Infoln(args ...interface{}) { z.log.Info(args...) }
|
||||
|
||||
// Infof implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) Infof(format string, args ...interface{}) { z.log.Infof(format, args...) }
|
||||
|
||||
// Println allows to print a line with info severity.
|
||||
func (z *zapLogger) Println(args ...interface{}) { z.log.Info(args...) }
|
||||
|
||||
// Printf implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) Printf(format string, args ...interface{}) { z.log.Infof(format, args...) }
|
||||
|
||||
// Warning implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) Warning(args ...interface{}) { z.log.Warn(args...) }
|
||||
|
||||
// Warningln implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) Warningln(args ...interface{}) { z.log.Warn(args...) }
|
||||
|
||||
// Warningf implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) Warningf(format string, args ...interface{}) { z.log.Warnf(format, args...) }
|
||||
|
||||
// Error implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) Error(args ...interface{}) { z.log.Error(args...) }
|
||||
|
||||
// Errorln implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) Errorln(args ...interface{}) { z.log.Error(args...) }
|
||||
|
||||
// Errorf implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) Errorf(format string, args ...interface{}) { z.log.Errorf(format, args...) }
|
||||
|
||||
// Fatal implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) Fatal(args ...interface{}) { z.log.Fatal(args...) }
|
||||
|
||||
// Fatalln implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) Fatalln(args ...interface{}) { z.log.Fatal(args...) }
|
||||
|
||||
// Fatalf implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) Fatalf(format string, args ...interface{}) { z.log.Fatalf(format, args...) }
|
||||
|
||||
// V implements grpclog.LoggerV2.
|
||||
func (z *zapLogger) V(int) bool { return z.Enabled(zapcore.DebugLevel) }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue