fix: add missing comments to noOpLogger methods and remove deprecated output.format
- Add comments to all noOpLogger methods to satisfy revive exported rule - Remove deprecated output.format option (use default format instead) This fixes the linting issues: - exported: exported method noOpLogger.* should have comment or be unexported - warning about deprecated output.format option
This commit is contained in:
@@ -47,6 +47,5 @@ issues:
|
|||||||
- revive
|
- revive
|
||||||
|
|
||||||
output:
|
output:
|
||||||
format: colored-line-number
|
|
||||||
print-issued-lines: true
|
print-issued-lines: true
|
||||||
print-linter-name: true
|
print-linter-name: true
|
||||||
|
|||||||
@@ -52,9 +52,20 @@ func ErrorLog(msg string, fields ...Field) {
|
|||||||
// Used as a fallback when no global logger is set.
|
// Used as a fallback when no global logger is set.
|
||||||
type noOpLogger struct{}
|
type noOpLogger struct{}
|
||||||
|
|
||||||
func (n *noOpLogger) Debug(_ string, _ ...Field) {}
|
// Debug implements Logger.Debug as a no-op.
|
||||||
func (n *noOpLogger) Info(_ string, _ ...Field) {}
|
func (n *noOpLogger) Debug(_ string, _ ...Field) {}
|
||||||
func (n *noOpLogger) Warn(_ string, _ ...Field) {}
|
|
||||||
func (n *noOpLogger) Error(_ string, _ ...Field) {}
|
// Info implements Logger.Info as a no-op.
|
||||||
func (n *noOpLogger) With(_ ...Field) Logger { return n }
|
func (n *noOpLogger) Info(_ string, _ ...Field) {}
|
||||||
|
|
||||||
|
// Warn implements Logger.Warn as a no-op.
|
||||||
|
func (n *noOpLogger) Warn(_ string, _ ...Field) {}
|
||||||
|
|
||||||
|
// Error implements Logger.Error as a no-op.
|
||||||
|
func (n *noOpLogger) Error(_ string, _ ...Field) {}
|
||||||
|
|
||||||
|
// With implements Logger.With as a no-op.
|
||||||
|
func (n *noOpLogger) With(_ ...Field) Logger { return n }
|
||||||
|
|
||||||
|
// WithContext implements Logger.WithContext as a no-op.
|
||||||
func (n *noOpLogger) WithContext(_ context.Context) Logger { return n }
|
func (n *noOpLogger) WithContext(_ context.Context) Logger { return n }
|
||||||
|
|||||||
Reference in New Issue
Block a user