Skip to content

Level.String panics if Level == InvalidLevel #75

@clementauger

Description

@clementauger

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions