apex / apex/log

Level.String panics if Level == InvalidLevel

Open
#75 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
1.4k
Forks
110
PR merge metrics
No merged PRs in 30d

Description

hi,

the method `LeveL.String` panics when `Level==InvalidLevel`.

https://github.com/apex/log/blob/master/levels.go#L44
https://github.com/apex/log/blob/master/levels.go#L17

I suggest to add a statement before the slice access so that this pseudo value does not appear in the `levelNames` / `levelStrings` variables.

It could return an empty string or something like `invalid`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.