Skip to content

Commit

Permalink
Clean up duplicate functions.
Browse files Browse the repository at this point in the history
  • Loading branch information
edoger committed Apr 14, 2021
1 parent f44eaee commit a36ccf6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 17 deletions.
5 changes: 0 additions & 5 deletions level.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ var allLevels = map[Level][]string{
TraceLevel: {"trace", "TRACE", "tac", "TAC"},
}

// AllLevels returns all supported log levels.
func AllLevels() []Level {
return []Level{PanicLevel, FatalLevel, ErrorLevel, WarnLevel, InfoLevel, DebugLevel, TraceLevel}
}

// String returns the string form of the current level.
// If the log level is not supported, always returns "unknown".
func (level Level) String() string {
Expand Down
12 changes: 0 additions & 12 deletions level_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,9 @@
package logger

import (
"fmt"
"testing"
)

func TestAllLevels(t *testing.T) {
ls := AllLevels()
if len(ls) != 7 {
t.Fatalf("AllLevels(): %v", ls)
}
want := []Level{PanicLevel, FatalLevel, ErrorLevel, WarnLevel, InfoLevel, DebugLevel, TraceLevel}
if fmt.Sprint(ls) != fmt.Sprint(want) {
t.Fatalf("AllLevels(): %v", ls)
}
}

func TestLevel_String(t *testing.T) {
items := []struct {
Given Level
Expand Down

0 comments on commit a36ccf6

Please sign in to comment.