Enum Class Severity
- All Implemented Interfaces:
Serializable,Comparable<Severity>,Constable
Log severity with the OpenTelemetry severity numbers.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic SeverityfromNumber(int number) intnumber()Returns the OpenTelemetry severity number.Parses a severity text case-insensitively.text()Returns the canonical severity text ("TRACE"…"FATAL").static SeverityReturns the enum constant of this class with the specified name.static Severity[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TRACE
OTel severity 1. -
DEBUG
OTel severity 5. -
INFO
OTel severity 9. -
WARN
OTel severity 13. -
ERROR
OTel severity 17. -
FATAL
OTel severity 21.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
number
public int number()Returns the OpenTelemetry severity number.- Returns:
- 1, 5, 9, 13, 17 or 21
-
text
Returns the canonical severity text ("TRACE"…"FATAL").- Returns:
- the upper-case name
-
fromNumber
Maps any OpenTelemetry severity number (1–24) to its severity range; 0 or less maps toINFO(unspecified) and numbers above 24 toFATAL.- Parameters:
number- OTel severity number- Returns:
- the severity whose range contains
number
-
parse
Parses a severity text case-insensitively. Accepts the canonical names plus the common aliasesWARNING,ERR,CRITICAL,PANIC,SEVERE,FINE,FINESTandINFORMATION.- Parameters:
text- severity text- Returns:
- the severity, or empty when the text is not recognised
-