A Level is the importance or severity of a log event. The higher the level, the more important or severe the event.

Hierarchy

  • Number
    • Level

Methods

  • MarshalJSON implements [encoding/json.Marshaler] by quoting the output of [Level.String].

    Returns string | number[]

  • MarshalText implements [encoding.TextMarshaler] by calling [Level.String].

    Returns string | number[]

  • String returns a name for the level. If the level has a name, then that name in uppercase is returned. If the level is between named values, then an integer is appended to the uppercased name. Examples:

     LevelWarn.String() => "WARN"
    (LevelInfo+2).String() => "INFO+2"

    Returns string

  • UnmarshalJSON implements [encoding/json.Unmarshaler] It accepts any string produced by [Level.MarshalJSON], ignoring case. It also accepts numeric offsets that would result in a different string on output. For example, "Error-8" would marshal as "INFO".

    Parameters

    • data: string | number[]

    Returns void

  • UnmarshalText implements [encoding.TextUnmarshaler]. It accepts any string produced by [Level.MarshalText], ignoring case. It also accepts numeric offsets that would result in a different string on output. For example, "Error-8" would marshal as "INFO".

    Parameters

    • data: string | number[]

    Returns void

Generated using TypeDoc