net.sf.xenqtt
Class Log

java.lang.Object
  extended by net.sf.xenqtt.Log

public final class Log
extends Object

Provides disparate logging methods for use within xenqtt. The Log class is able to detect other logging implementations and, should they be present and available, use those by default. Should other logging implementations not be available the fallback logging mechanism will be used.

At present the fallback logging mechanism writes all trace, debug, and info logging events to standard out and all warn, error, and fatal logging events to standard error.


Method Summary
static void debug(String message, Object... parameters)
          Log a message at the DEBUG log level, if possible.
static void error(String message, Object... parameters)
          Log a message at the ERROR log level, if possible.
static void error(Throwable t, String message, Object... parameters)
          Log a message at the ERROR log level, if possible.
static void fatal(String message, Object... parameters)
          Log a message at the FATAL log level.
static void fatal(Throwable t, String message, Object... parameters)
          Log a message at the FATAL log level.
static void info(String message, Object... parameters)
          Log a message at the INFO log level, if possible.
static void setLoggingDestination(String outputFile)
           
static void setLoggingLevels(LoggingLevels levels)
          Set the logging levels to use.
static void trace(String message, Object... parameters)
          Log a message at the TRACE log level, if possible.
static void warn(String message, Object... parameters)
          Log a message at the WARN log level, if possible.
static void warn(Throwable t, String message, Object... parameters)
          Log a message at the WARN log level, if possible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setLoggingLevels

public static void setLoggingLevels(LoggingLevels levels)
Set the logging levels to use. This method will only update the logging levels for the asynchronous logging mode. Level changes for synchronous loggers are not supported by this API.

Parameters:
levels - The logging levels to use

setLoggingDestination

public static void setLoggingDestination(String outputFile)

trace

public static void trace(String message,
                         Object... parameters)
Log a message at the TRACE log level, if possible.

Parameters:
message - The log message to emit
parameters - The parameters to use in replacing format specifiers in the specified message. This can be omitted if no such specifiers exist

debug

public static void debug(String message,
                         Object... parameters)
Log a message at the DEBUG log level, if possible.

Parameters:
message - The log message to emit
parameters - The parameters to use in replacing format specifiers in the specified message. This can be omitted if no such specifiers exist

info

public static void info(String message,
                        Object... parameters)
Log a message at the INFO log level, if possible.

Parameters:
message - The log message to emit
parameters - The parameters to use in replacing format specifiers in the specified message. This can be omitted if no such specifiers exist

warn

public static void warn(String message,
                        Object... parameters)
Log a message at the WARN log level, if possible.

Parameters:
message - The log message to emit
parameters - The parameters to use in replacing format specifiers in the specified message. This can be omitted if no such specifiers exist

warn

public static void warn(Throwable t,
                        String message,
                        Object... parameters)
Log a message at the WARN log level, if possible.

Parameters:
t - A Throwable that was thrown at some point that is being logged with the message and parameters
message - The log message to emit
parameters - The parameters to use in replacing format specifiers in the specified message. This can be omitted if no such specifiers exist

error

public static void error(String message,
                         Object... parameters)
Log a message at the ERROR log level, if possible.

Parameters:
message - The log message to emit
parameters - The parameters to use in replacing format specifiers in the specified message. This can be omitted if no such specifiers exist

error

public static void error(Throwable t,
                         String message,
                         Object... parameters)
Log a message at the ERROR log level, if possible.

Parameters:
t - A Throwable that was thrown at some point that is being logged with the message and parameters
message - The log message to emit
parameters - The parameters to use in replacing format specifiers in the specified message. This can be omitted if no such specifiers exist

fatal

public static void fatal(String message,
                         Object... parameters)
Log a message at the FATAL log level.

Parameters:
message - The log message to emit
parameters - The parameters to use in replacing format specifiers in the specified message. This can be omitted if no such specifiers exist

fatal

public static void fatal(Throwable t,
                         String message,
                         Object... parameters)
Log a message at the FATAL log level.

Parameters:
t - A Throwable that was thrown at some point that is being logged with the message and parameters
message - The log message to emit
parameters - The parameters to use in replacing format specifiers in the specified message. This can be omitted if no such specifiers exist


Copyright © 2013. All Rights Reserved.