Skip to content

Commit

Permalink
add ability to silently log (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
keefertaylor authored Nov 2, 2024
1 parent b57b262 commit 4790902
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 0 additions & 1 deletion log/logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/tessellated-io/pickaxe/log"
)

func TestLogging_NoPrefix(t *testing.T) {
logger := log.NewLogger("info")

Expand Down
2 changes: 2 additions & 0 deletions log/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ func ParseLogLevel(input string) slog.Level {
return slog.LevelWarn
case "error":
return slog.LevelError
case "silent":
return slog.LevelError + 1
default:
fmt.Printf("😬 Unable to parse a log level from input: \"%s\". Defaulting to log at INFO level.\n", input)
return slog.LevelInfo
Expand Down

0 comments on commit 4790902

Please sign in to comment.