Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Severity ¶
type Severity int
Severity represents a log record severity (also known as log level). Smaller numerical values correspond to less severe log records (such as debug events), larger numerical values correspond to more severe log records (such as errors and critical events). Wrap over https://pkg.go.dev/go.opentelemetry.io/otel/log#Severity
const ( // NONE represents an unset Severity. NONE Severity = iota // UNDEFINED // A fine-grained debugging log record. Typically disabled in default // configurations. TRACE TRACE2 TRACE3 TRACE4 // A debugging log record. DEBUG DEBUG2 DEBUG3 DEBUG4 // An informational log record. Indicates that an event happened. INFO INFO2 INFO3 INFO4 // A warning log record. Not an error but is likely more important than an // informational event. WARN WARN2 WARN3 WARN4 // An error log record. Something went wrong. ERROR ERROR2 ERROR3 ERROR4 // A fatal log record such as application or system crash. FATAL FATAL2 FATAL3 FATAL4 )
func (Severity) MarshalJSON ¶
MarshalJSON implements encoding/json.Marshaler by quoting the output of [Level.String].
func (Severity) MarshalText ¶
MarshalText implements encoding.TextMarshaler by calling [Level.String].
func (Severity) String ¶
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"
func (*Severity) UnmarshalJSON ¶
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".
func (*Severity) UnmarshalText ¶
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".