Package org.jmol.util
Class Logger
java.lang.Object
org.jmol.util.Logger
Logger mechanism.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final boolean[]
private static LoggerInterface
private static boolean
static boolean
static boolean
static final int
static final int
static final int
static final int
static final int
static final int
static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static int
checkTimer
(String msg, boolean andReset) static void
Writes a log at DEBUG level.static void
doLogLevel
(boolean log) Indicates if the level is logged.static void
Writes a log at ERROR level.static void
Writes a log at ERROR level with detail on exception.static void
Writes a log at FATAL level.static void
Writes a log at FATAL level with detail on exception.static String
getLevel
(int level) Returns the text corresponding to a level.static int
private static boolean
getProperty
(String level, boolean defaultValue) private static int
getTimeFrom
(String msg) static String
getTimerMsg
(String msg, int time) static void
og* Writes a log at INFO level.static boolean
isActiveLevel
(int level) Tells if a logging level is active.static boolean
logLevel()
Indicates if the level is logged.static void
setActiveLevel
(int level, boolean active) Changes the activation state for a logging level.static void
setLogger
(LoggerInterface logger) Replaces the current logger implementation by a new one.static void
setLogLevel
(int level) Activates all logging levels up through a given level.static void
startTimer
(String msg) static void
Writes a log at WARN level.static void
Writes a log at WARN level with detail on exception.
-
Field Details
-
_logger
-
LEVEL_FATAL
public static final int LEVEL_FATAL- See Also:
-
LEVEL_ERROR
public static final int LEVEL_ERROR- See Also:
-
LEVEL_WARN
public static final int LEVEL_WARN- See Also:
-
LEVEL_INFO
public static final int LEVEL_INFO- See Also:
-
LEVEL_DEBUG
public static final int LEVEL_DEBUG- See Also:
-
LEVEL_DEBUGHIGH
public static final int LEVEL_DEBUGHIGH- See Also:
-
LEVEL_MAX
public static final int LEVEL_MAX- See Also:
-
_activeLevels
private static final boolean[] _activeLevels -
_logLevel
private static boolean _logLevel -
debugging
public static boolean debugging -
debuggingHigh
public static boolean debuggingHigh -
htTiming
-
-
Constructor Details
-
Logger
private Logger()
-
-
Method Details
-
getProperty
-
setLogger
Replaces the current logger implementation by a new one.- Parameters:
logger
- New logger implementation.
-
isActiveLevel
public static boolean isActiveLevel(int level) Tells if a logging level is active.- Parameters:
level
- Logging level.- Returns:
- Active.
-
setActiveLevel
public static void setActiveLevel(int level, boolean active) Changes the activation state for a logging level.- Parameters:
level
- Level.active
- New activation state.
-
setLogLevel
public static void setLogLevel(int level) Activates all logging levels up through a given level.- Parameters:
level
-
-
getLevel
Returns the text corresponding to a level.- Parameters:
level
- Level.- Returns:
- Corresponding text.
-
logLevel
public static boolean logLevel()Indicates if the level is logged.- Returns:
- Indicator.
-
doLogLevel
public static void doLogLevel(boolean log) Indicates if the level is logged.- Parameters:
log
- Indicator.
-
debug
Writes a log at DEBUG level.- Parameters:
txt
- String to write.
-
info
og* Writes a log at INFO level.- Parameters:
txt
- String to write.
-
warn
Writes a log at WARN level.- Parameters:
txt
- String to write.
-
warnEx
Writes a log at WARN level with detail on exception.- Parameters:
txt
- String to write.e
- Exception.
-
error
Writes a log at ERROR level.- Parameters:
txt
- String to write.
-
errorEx
Writes a log at ERROR level with detail on exception.- Parameters:
txt
- String to write.e
- Exception.
-
getLogLevel
public static int getLogLevel() -
fatal
Writes a log at FATAL level.- Parameters:
txt
- String to write.
-
fatalEx
Writes a log at FATAL level with detail on exception.- Parameters:
txt
- String to write.e
- Exception.
-
startTimer
-
getTimerMsg
-
getTimeFrom
-
checkTimer
-
checkMemory
public static void checkMemory()
-