java.lang.Object
swim.util.Severity
- All Implemented Interfaces:
Comparable<Severity>
Level of importance. Used for log levels and diagnostic classifications.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Method Summary
Modifier and TypeMethodDescriptionstatic Severity
alert()
Returns theSeverity
withALERT_LEVEL
of importance.static Severity
Returns aSeverity
withALERT_LEVEL
of importance, and the given descriptivelabel
.int
static Severity
Returns aSeverity
with the given importancelevel
, and descriptivelabel
.static Severity
debug()
Returns theSeverity
withDEBUG_LEVEL
of importance.static Severity
Returns aSeverity
withDEBUG_LEVEL
of importance, and the given descriptivelabel
.boolean
static Severity
error()
Returns theSeverity
withERROR_LEVEL
of importance.static Severity
Returns aSeverity
withERROR_LEVEL
of importance, and the given descriptivelabel
.static Severity
fatal()
Returns theSeverity
withFATAL_LEVEL
of importance.static Severity
Returns aSeverity
withFATAL_LEVEL
of importance, and the given descriptivelabel
.static Severity
from
(int level) Returns theSeverity
with the given importancelevel
.int
hashCode()
static Severity
info()
Returns theSeverity
withINFO_LEVEL
of importance.static Severity
Returns aSeverity
withINFO_LEVEL
of importance, and the given descriptivelabel
.boolean
isAlert()
Returnstrue
if thisSeverity
hasALERT_LEVEL
of importance.boolean
isDebug()
Returnstrue
if thisSeverity
hasDEBUG_LEVEL
of importance.boolean
isError()
Returnstrue
if thisSeverity
hasERROR_LEVEL
of importance.boolean
isFatal()
Returnstrue
if thisSeverity
hasFATAL_LEVEL
of importance.boolean
isInfo()
Returnstrue
if thisSeverity
hasINFO_LEVEL
of importance.boolean
isNote()
Returnstrue
if thisSeverity
hasNOTE_LEVEL
of importance.boolean
isTrace()
Returnstrue
if thisSeverity
hasTRACE_LEVEL
of importance.boolean
Returnstrue
if thisSeverity
hasWARNING_LEVEL
of importance.label()
Returns a descriptive label for thisSeverity
.Returns a newSeverity
with the same level as thisSeverity
, but with a new descriptivelabel
.int
level()
Returns the integer level of importance of thisSeverity
, with higher levels signifying greater importance.static Severity
note()
Returns theSeverity
withNOTE_LEVEL
of importance.static Severity
Returns aSeverity
withNOTE_LEVEL
of importance, and the given descriptivelabel
.toString()
static Severity
trace()
Returns theSeverity
withTRACE_LEVEL
of importance.static Severity
Returns aSeverity
withTRACE_LEVEL
of importance, and the given descriptivelabel
.static Severity
warning()
Returns theSeverity
withWARNING_LEVEL
of importance.static Severity
Returns aSeverity
withWARNING_LEVEL
of importance, and the given descriptivelabel
.
-
Field Details
-
TRACE_LEVEL
public static final int TRACE_LEVEL- See Also:
-
DEBUG_LEVEL
public static final int DEBUG_LEVEL- See Also:
-
INFO_LEVEL
public static final int INFO_LEVEL- See Also:
-
NOTE_LEVEL
public static final int NOTE_LEVEL- See Also:
-
WARNING_LEVEL
public static final int WARNING_LEVEL- See Also:
-
ERROR_LEVEL
public static final int ERROR_LEVEL- See Also:
-
ALERT_LEVEL
public static final int ALERT_LEVEL- See Also:
-
FATAL_LEVEL
public static final int FATAL_LEVEL- See Also:
-
-
Method Details
-
level
public int level()Returns the integer level of importance of thisSeverity
, with higher levels signifying greater importance.- Returns:
- an integer between
0
and7
, inclusive. One ofTRACE_LEVEL
,DEBUG_LEVEL
,INFO_LEVEL
,NOTE_LEVEL
,WARNING_LEVEL
,ERROR_LEVEL
,ALERT_LEVEL
, orFATAL_LEVEL
.
-
label
Returns a descriptive label for thisSeverity
. -
label
Returns a newSeverity
with the same level as thisSeverity
, but with a new descriptivelabel
. -
isTrace
public boolean isTrace()Returnstrue
if thisSeverity
hasTRACE_LEVEL
of importance. -
isDebug
public boolean isDebug()Returnstrue
if thisSeverity
hasDEBUG_LEVEL
of importance. -
isInfo
public boolean isInfo()Returnstrue
if thisSeverity
hasINFO_LEVEL
of importance. -
isNote
public boolean isNote()Returnstrue
if thisSeverity
hasNOTE_LEVEL
of importance. -
isWarning
public boolean isWarning()Returnstrue
if thisSeverity
hasWARNING_LEVEL
of importance. -
isError
public boolean isError()Returnstrue
if thisSeverity
hasERROR_LEVEL
of importance. -
isAlert
public boolean isAlert()Returnstrue
if thisSeverity
hasALERT_LEVEL
of importance. -
isFatal
public boolean isFatal()Returnstrue
if thisSeverity
hasFATAL_LEVEL
of importance. -
compareTo
- Specified by:
compareTo
in interfaceComparable<Severity>
-
equals
-
hashCode
public int hashCode() -
toString
-
create
Returns aSeverity
with the given importancelevel
, and descriptivelabel
.- Throws:
IllegalArgumentException
- iflevel
is not a valid level of importance.
-
from
Returns theSeverity
with the given importancelevel
.- Throws:
IllegalArgumentException
- iflevel
is not a valid level of importance.
-
trace
Returns theSeverity
withTRACE_LEVEL
of importance. -
trace
Returns aSeverity
withTRACE_LEVEL
of importance, and the given descriptivelabel
. -
debug
Returns theSeverity
withDEBUG_LEVEL
of importance. -
debug
Returns aSeverity
withDEBUG_LEVEL
of importance, and the given descriptivelabel
. -
info
Returns theSeverity
withINFO_LEVEL
of importance. -
info
Returns aSeverity
withINFO_LEVEL
of importance, and the given descriptivelabel
. -
note
Returns theSeverity
withNOTE_LEVEL
of importance. -
note
Returns aSeverity
withNOTE_LEVEL
of importance, and the given descriptivelabel
. -
warning
Returns theSeverity
withWARNING_LEVEL
of importance. -
warning
Returns aSeverity
withWARNING_LEVEL
of importance, and the given descriptivelabel
. -
error
Returns theSeverity
withERROR_LEVEL
of importance. -
error
Returns aSeverity
withERROR_LEVEL
of importance, and the given descriptivelabel
. -
alert
Returns theSeverity
withALERT_LEVEL
of importance. -
alert
Returns aSeverity
withALERT_LEVEL
of importance, and the given descriptivelabel
. -
fatal
Returns theSeverity
withFATAL_LEVEL
of importance. -
fatal
Returns aSeverity
withFATAL_LEVEL
of importance, and the given descriptivelabel
.
-