|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.ifremer.isisfish.logging.LogLevelUtil
public class LogLevelUtil
This classes contains some usefull methods to perform actions on
set of LogLevel.
To make performant filtering operations on a lots of LogRecord,
we use as representation for set of LogLevel an integer
as the sum of the LogLevel.mask() values.
0 value correspond to all levels and is a violating the rule
(but how to make a search with no level ?)
to test if a set of LogLevel contains a given LogLevel use
contains(int, int)
to add a level in a set of LogLevel use addToSet(int, int)
to remove a level in a set of LogLevel use removeFromSet(int, int)
to obtain all levels contained in a set of LogLevel use
getLogLevels(int)
LogLevel| Constructor Summary | |
|---|---|
LogLevelUtil()
|
|
| Method Summary | |
|---|---|
static int |
addToSet(int ordinal,
int setOflevels)
add a LogLevel to a set |
static boolean |
contains(int ordinal,
int levels)
Using a performant algorithm to know if a LogLevel is contained in a list of levels using his severity. |
static int |
createSet(int firstOrdinal,
int... ordinals)
Compute the sum of levels toInit() value for all given levels (given with their ordinal value). |
static int |
createSet(LogLevel firstLevel,
LogLevel... levels)
|
static LogLevel[] |
getLogLevels(int levels)
|
static int |
removeFromSet(int ordinal,
int setOfLevels)
remove a LogLevel from a set |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LogLevelUtil()
| Method Detail |
|---|
public static boolean contains(int ordinal,
int levels)
ordinal - the ordinal of the levellevels - the sums of levels
true if this level is in levels given.public static LogLevel[] getLogLevels(int levels)
public static int createSet(int firstOrdinal,
int... ordinals)
firstOrdinal - the first level of levels to useordinals - the level of levels to use
public static int createSet(LogLevel firstLevel,
LogLevel... levels)
public static int addToSet(int ordinal,
int setOflevels)
ordinal - the ordinal of the level to addsetOflevels - the sum of mask() of some LogLevel
levels levels)
public static int removeFromSet(int ordinal,
int setOfLevels)
ordinal - the ordinal of the level to removesetOfLevels - the sum of mask() of some LogLevel
levels levels)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||