Enum ReportLevel
- java.lang.Object
-
- java.lang.Enum<ReportLevel>
-
- de.rwth.swc.coffee4j.algorithmic.report.ReportLevel
-
- All Implemented Interfaces:
Serializable
,Comparable<ReportLevel>
public enum ReportLevel extends Enum<ReportLevel>
Specifies an easy means to filter report content based on severity. This is basically the same mechanism as used by any other reporting or logging framework.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description DEBUG
Should be used for general debugging information.ERROR
Should be used for things fatal to the current operation, but not the whole process.FATAL
An error which leads to the complete shutdown, so one from which the application cannot possible recover.INFO
Should be used for normal logging of things such as start/stop/configuration, but not everything.TRACE
Should be used if the report is only used for real in depth debugging by developers who know the code.WARN
Should be used for things which could later likely cause failures or any very special reporting from level info which states a non-normal condition.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isWorseThanOrEqualTo(ReportLevel otherLevel)
Checks if the level given to the method is higher than the own level, or at least equal.static ReportLevel
valueOf(String name)
Returns the enum constant of this type with the specified name.static ReportLevel[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
TRACE
public static final ReportLevel TRACE
Should be used if the report is only used for real in depth debugging by developers who know the code.
-
DEBUG
public static final ReportLevel DEBUG
Should be used for general debugging information. This may not only help developers but also users who want to understand a problem with the application.
-
INFO
public static final ReportLevel INFO
Should be used for normal logging of things such as start/stop/configuration, but not everything. This is generally a level in which users are interested in for a quick overview of what could have went wrong, or what is happening in the application to know if application is running correctly.
-
WARN
public static final ReportLevel WARN
Should be used for things which could later likely cause failures or any very special reporting from level info which states a non-normal condition.
-
ERROR
public static final ReportLevel ERROR
Should be used for things fatal to the current operation, but not the whole process.
-
FATAL
public static final ReportLevel FATAL
An error which leads to the complete shutdown, so one from which the application cannot possible recover.
-
-
Method Detail
-
values
public static ReportLevel[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ReportLevel c : ReportLevel.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ReportLevel valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException
- if the argument is null
-
isWorseThanOrEqualTo
public boolean isWorseThanOrEqualTo(ReportLevel otherLevel)
Checks if the level given to the method is higher than the own level, or at least equal. For example, this method would returntrue
if called on info with info, warn, error or fatal, butfalse
if called with trace or debug as those levels are below info.- Parameters:
otherLevel
- the level to which the own one is compared- Returns:
- whether the given level is worse or equals (depending on the severity)
-
-