From 8aaef529f5c8421f0b99ddc93c1c70828ad281b7 Mon Sep 17 00:00:00 2001 From: Eduardo Aguilar Date: Wed, 17 Apr 2024 14:50:44 -0600 Subject: [PATCH] feat: reorder levels --- levels/levels.go | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/levels/levels.go b/levels/levels.go index 24f36d3..623440b 100644 --- a/levels/levels.go +++ b/levels/levels.go @@ -25,8 +25,14 @@ var ( type Level int8 const ( + // NoLevel defines an absent log level. + NoLevel Level = iota + 1 + // Disabled disables the logger. + Disabled + // TraceLevel defines trace log level. + TraceLevel // Debug defines debug log level. - Debug Level = iota + 1 + Debug // Info defines info log level. Info // Warn defines warn log level. @@ -37,19 +43,13 @@ const ( Fatal // Panic defines panic log level. Panic - // NoLevel defines an absent log level. - NoLevel - // Disabled disables the logger. - Disabled - - // TraceLevel defines trace log level. - TraceLevel Level = -1 - // Values less than TraceLevel are handled as numbers. ) // String returns the string representation of the log level int. func (l Level) String() string { values := map[Level]string{ + NoLevel: "", + Disabled: "disabled", TraceLevel: TraceValue, Debug: DebugValue, Info: InfoValue, @@ -57,8 +57,6 @@ func (l Level) String() string { Error: ErrorValue, Fatal: FatalValue, Panic: PanicValue, - Disabled: "disabled", - NoLevel: "", } if value, exists := values[l]; exists {