org.systinet.logging
Class Category

java.lang.Object
  extended byorg.systinet.logging.Category

public class Category
extends java.lang.Object

This class provides methods for logging. For retrieving an instance of the Category use the method getCategory(String).

Component:
Core

Field Summary
static int DEBUG
          The DEBUG level designates fine-grained informational events that are most useful to debug an application.
static int ERROR
          The ERROR level designates error events that might still allow the application to continue running.
static int INFO
          The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.
static int NONE
          The NONE level is intended to turn off logging.
static int WARN
          The WARN level designates potentially harmful situations.
 
Method Summary
 void assertLog(boolean assertion, java.lang.String msg)
          If assertion parameter is false, then logs msg as an error statement.
 void debug(java.lang.Object message)
          Log an object with debug priority.
 void debug(java.lang.String message)
          Log a message with debug priority.
 void debug(java.lang.String message, java.lang.Throwable t)
          Log a message with the debug priority.
 void error(java.lang.Object message)
          Log an object with error priority.
 void error(java.lang.String message)
          Log a message with error priority.
 void error(java.lang.String message, java.lang.Throwable t)
          Log a message with the error priority.
static Category getCategory(java.lang.String name)
          Gets a category with named as the name parameter.
 int getDebugLevel()
          Gets the level of this Category.
 java.lang.String getName()
          Gets the category name.
 void info(java.lang.Object message)
          Log an object with the info priority.
 void info(java.lang.String message)
          Log a message with info priority.
 void info(java.lang.String message, java.lang.Throwable t)
          Log a message with the info priority.
 boolean isDebugEnabled()
          Check whether this category is enabled for the debug priority.
 boolean isInfoEnabled()
          Check whether this category is enabled for the info priority.
 void setDebugLevel(int level)
          Set the level of this Category.
 void warn(java.lang.Object message)
          Log an object with warn priority.
 void warn(java.lang.String message)
          Log a message with warn priority.
 void warn(java.lang.String message, java.lang.Throwable t)
          Log a message with the warn priority.
 
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
The DEBUG level designates fine-grained informational events that are most useful to debug an application.

See Also:
Constant Field Values

INFO

public static final int INFO
The INFO level designates informational messages that highlight the progress of the application at coarse-grained level.

See Also:
Constant Field Values

WARN

public static final int WARN
The WARN level designates potentially harmful situations.

See Also:
Constant Field Values

ERROR

public static final int ERROR
The ERROR level designates error events that might still allow the application to continue running.

See Also:
Constant Field Values

NONE

public static final int NONE
The NONE level is intended to turn off logging.

See Also:
Constant Field Values
Method Detail

getCategory

public static Category getCategory(java.lang.String name)
Gets a category with named as the name parameter.

Parameters:
name - the name of a category to get
Returns:
instance of a category

assertLog

public void assertLog(boolean assertion,
                      java.lang.String msg)
If assertion parameter is false, then logs msg as an error statement.

Parameters:
assertion -
msg - The message to print if assertion is false.

debug

public void debug(java.lang.Object message)
Log an object with debug priority.

Parameters:
message - object to convert to String before writing into the log file

debug

public void debug(java.lang.String message)
Log a message with debug priority.

Parameters:
message - string to write in the log file

debug

public void debug(java.lang.String message,
                  java.lang.Throwable t)
Log a message with the debug priority.

Parameters:
message - string to append
t - the exception to log, including a stack trace

error

public void error(java.lang.Object message)
Log an object with error priority.

Parameters:
message - object to convert to String before writing into the log file

error

public void error(java.lang.String message)
Log a message with error priority.

Parameters:
message - string to write in the log file

error

public void error(java.lang.String message,
                  java.lang.Throwable t)
Log a message with the error priority.

Parameters:
message - string to append
t - the exception to log, including a stack trace

getName

public final java.lang.String getName()
Gets the category name.

Returns:
category name

info

public void info(java.lang.Object message)
Log an object with the info priority.

Parameters:
message - object to convert to String before writing into the log file

info

public void info(java.lang.String message)
Log a message with info priority.

Parameters:
message - string to write in the log file

info

public void info(java.lang.String message,
                 java.lang.Throwable t)
Log a message with the info priority.

Parameters:
message - string to append
t - the exception to log, including a stack trace

isDebugEnabled

public boolean isDebugEnabled()
Check whether this category is enabled for the debug priority.

Returns:
true if this category is debug enabled, false otherwise.

isInfoEnabled

public boolean isInfoEnabled()
Check whether this category is enabled for the info priority.

Returns:
true if this category is info enabled, false otherwise.

warn

public void warn(java.lang.Object message)
Log an object with warn priority.

Parameters:
message - object to convert to String before writing into the log file

warn

public void warn(java.lang.String message)
Log a message with warn priority.

Parameters:
message - string to write in the log file

warn

public void warn(java.lang.String message,
                 java.lang.Throwable t)
Log a message with the warn priority.

Parameters:
message - string to append
t - the exception to log, including a stack trace

getDebugLevel

public int getDebugLevel()
Gets the level of this Category.

Returns:
category level

setDebugLevel

public void setDebugLevel(int level)
Set the level of this Category. You can pass any of Category.DEBUG, Category.INFO, Category.WARN, Category.ERROR, Category.NONE as a parameter.

Parameters:
level - category level