Skip to content

Commit 5f6d343

Browse files
committed
logger: add InvalidLevel
Signed-off-by: Valery Piashchynski <[email protected]>
1 parent 36772e7 commit 5f6d343

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

.golangci.yml

-3
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ linters: # All available linters list: <https://golangci-lint.run/usage/linters/
4545
enable:
4646
- asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers
4747
- bodyclose # Checks whether HTTP response body is closed successfully
48-
- deadcode # Finds unused code
4948
- depguard # Go linter that checks if package imports are in a list of acceptable packages
5049
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f())
5150
- dupl # Tool for code clone detection
@@ -74,14 +73,12 @@ linters: # All available linters list: <https://golangci-lint.run/usage/linters/
7473
- prealloc # Finds slice declarations that could potentially be preallocated
7574
- rowserrcheck # Checks whether Err of rows is checked successfully
7675
- staticcheck # Staticcheck is a go vet on steroids, applying a ton of static analysis checks
77-
- structcheck # Finds unused struct fields
7876
- stylecheck # Stylecheck is a replacement for golint
7977
- tparallel # detects inappropriate usage of t.Parallel() method in your Go test codes
8078
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
8179
- unconvert # Remove unnecessary type conversions
8280
- unparam # Reports unused function parameters
8381
- unused # Checks Go code for unused constants, variables, functions and types
84-
- varcheck # Finds unused global variables and constants
8582
- whitespace # Tool for detection of leading and trailing whitespace
8683

8784
issues:

logger/logger.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ func ColoredLevelEncoder(level zapcore.Level, enc zapcore.PrimitiveArrayEncoder)
121121
enc.AppendString(color.HiYellowString(level.CapitalString()))
122122
case zapcore.ErrorLevel, zapcore.DPanicLevel:
123123
enc.AppendString(color.HiRedString(level.CapitalString()))
124-
case zapcore.PanicLevel, zapcore.FatalLevel:
124+
case zapcore.PanicLevel, zapcore.FatalLevel, zapcore.InvalidLevel:
125125
enc.AppendString(color.HiMagentaString(level.CapitalString()))
126126
}
127127
}

0 commit comments

Comments
 (0)