net.sf.jaxodraw.util
Class JaxoLog

java.lang.Object
  extended by net.sf.jaxodraw.util.JaxoLog

public final class JaxoLog
extends Object

Some custom methods to handle error messages.

Since:
2.0

Field Summary
static int DEBUG
          DEBUG logging level (most verbose).
static int INFO
          INFO logging level (default).
static int WARN
          WARN logging level (least verbose).
 
Method Summary
static void debug(Exception e)
          Logs a DEBUG message.
static void debug(String message)
          Logs a DEBUG message.
static void debug(String message, Exception e)
          Logs a DEBUG message.
static void debugI18N(String messageKey)
          Logs a DEBUG message.
static void debugI18N(String messageKey, Exception e)
          Logs a DEBUG message.
static int getCurrentLevel()
          Gets the current logging level.
static Level getLevelFor(int level)
          Converts JaxoLog levels to java.util.logging.Level.
static JaxoLogger getLogger()
          Returns the current logger.
static void info(Exception e)
          Logs an INFO message.
static void info(String message)
          Logs an INFO message.
static void info(String message, Exception e)
          Logs an INFO message.
static void infoI18N(String messageKey)
          Logs an INFO message.
static void infoI18N(String messageKey, Exception e)
          Logs an INFO message.
static boolean isLoggable(int level)
          Check if a message of the given level would actually be logged by the current logger.
static void log(int level, Exception e)
          Logs a log message with given level.
static void log(int level, String message)
          Logs a log message with given level.
static void log(int level, String message, Exception e)
          Logs a log message with given level.
static void logI18N(int level, String messageKey)
          Logs a log message with given level.
static void logI18N(int level, String messageKey, Exception e)
          Logs a log message with given level.
static void setLevel(int level)
          Sets the logging level.
static void setLogger(JaxoLogger newLogger)
          Sets a logger.
static void warn(Exception e)
          Logs a WARNING message.
static void warn(String message)
          Logs a WARNING message.
static void warn(String message, Exception e)
          Logs a WARNING message.
static void warnI18N(String messageKey)
          Logs a WARNING message.
static void warnI18N(String messageKey, Exception e)
          Logs a WARNING message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static final int DEBUG
DEBUG logging level (most verbose).


INFO

public static final int INFO
INFO logging level (default).


WARN

public static final int WARN
WARN logging level (least verbose).

Method Detail

getLogger

public static JaxoLogger getLogger()
Returns the current logger.

Returns:
a JaxoLogger.

setLogger

public static void setLogger(JaxoLogger newLogger)
Sets a logger. If this is not called explicitly, a default logger will be used by JaxoDraw. Set this to null to completely disable any logging.

Parameters:
newLogger - a JaxoLogger.

setLevel

public static void setLevel(int level)
Sets the logging level.

Parameters:
level - One of the levels defined by this class.

getCurrentLevel

public static int getCurrentLevel()
Gets the current logging level.

Returns:
One of the levels defined by this class.

isLoggable

public static boolean isLoggable(int level)
Check if a message of the given level would actually be logged by the current logger.

Parameters:
level - One of the levels defined by this class.
Returns:
true if the given message level is currently being logged.

debug

public static void debug(String message)
Logs a DEBUG message.

Parameters:
message - The log message.

debugI18N

public static void debugI18N(String messageKey)
Logs a DEBUG message. The actual message is looked up in one of the resource bundles defined by JaxoDraw via the given messageKey.

Parameters:
messageKey - The ResourceBundle key to look up the log message.

debug

public static void debug(String message,
                         Exception e)
Logs a DEBUG message.

Parameters:
message - The log message.
e - An exception to be appended to the message.

debugI18N

public static void debugI18N(String messageKey,
                             Exception e)
Logs a DEBUG message. The actual message is looked up in one of the resource bundles defined by JaxoDraw via the given messageKey.

Parameters:
messageKey - The ResourceBundle key to look up the log message.
e - An exception to be appended to the message.

debug

public static void debug(Exception e)
Logs a DEBUG message.

Parameters:
e - An exception to be logged.

info

public static void info(String message)
Logs an INFO message.

Parameters:
message - The log message.

infoI18N

public static void infoI18N(String messageKey)
Logs an INFO message. The actual message is looked up in one of the resource bundles defined by JaxoDraw via the given messageKey.

Parameters:
messageKey - The ResourceBundle key to look up the log message.

info

public static void info(String message,
                        Exception e)
Logs an INFO message.

Parameters:
message - The log message.
e - An exception to be appended to the message.

infoI18N

public static void infoI18N(String messageKey,
                            Exception e)
Logs an INFO message. The actual message is looked up in one of the resource bundles defined by JaxoDraw via the given messageKey.

Parameters:
messageKey - The ResourceBundle key to look up the log message.
e - An exception to be appended to the message.

info

public static void info(Exception e)
Logs an INFO message.

Parameters:
e - An exception to be logged.

warn

public static void warn(String message)
Logs a WARNING message.

Parameters:
message - The log message.

warnI18N

public static void warnI18N(String messageKey)
Logs a WARNING message. The actual message is looked up in one of the resource bundles defined by JaxoDraw via the given messageKey.

Parameters:
messageKey - The ResourceBundle key to look up the log message.

warn

public static void warn(String message,
                        Exception e)
Logs a WARNING message.

Parameters:
message - The log message.
e - An exception to be appended to the message.

warnI18N

public static void warnI18N(String messageKey,
                            Exception e)
Logs a WARNING message. The actual message is looked up in one of the resource bundles defined by JaxoDraw via the given messageKey.

Parameters:
messageKey - The ResourceBundle key to look up the log message.
e - An exception to be appended to the message.

warn

public static void warn(Exception e)
Logs a WARNING message.

Parameters:
e - An exception to be logged.

log

public static void log(int level,
                       String message)
Logs a log message with given level.

Parameters:
level - The log level.
message - The log message.

logI18N

public static void logI18N(int level,
                           String messageKey)
Logs a log message with given level. The actual message is looked up in one of the resource bundles defined by JaxoDraw via the given messageKey.

Parameters:
level - The log level.
messageKey - The ResourceBundle key to look up the log message.

log

public static void log(int level,
                       String message,
                       Exception e)
Logs a log message with given level.

Parameters:
level - The log level.
message - The log message.
e - An exception to be appended to the message.

logI18N

public static void logI18N(int level,
                           String messageKey,
                           Exception e)
Logs a log message with given level. The actual message is looked up in one of the resource bundles defined by JaxoDraw via the given messageKey.

Parameters:
level - The log level.
messageKey - The ResourceBundle key to look up the log message.
e - An exception to be appended to the message.

log

public static void log(int level,
                       Exception e)
Logs a log message with given level.

Parameters:
level - The log level.
e - An exception to be logged.

getLevelFor

public static Level getLevelFor(int level)
Converts JaxoLog levels to java.util.logging.Level.

Parameters:
level - A level defined by this class.
Returns:
the corresponding java.util.logging.Level.


Copyright © 2003-2011 The JaxoDraw team. All Rights Reserved.