org.hackystat.utilities.logger
Class HackystatLogger

java.lang.Object
  extended by org.hackystat.utilities.logger.HackystatLogger

public final class HackystatLogger
extends java.lang.Object

Supports logging of informational and error messages by a service. Uses HackystatUserHome.getHome() to determine where to put the logs directory.

Author:
Philip Johnson

Method Summary
static java.util.logging.Logger getLogger(java.lang.String loggerName)
          Return the Hackystat Logger named with loggerName, creating it if it does not yet exist.
static java.util.logging.Logger getLogger(java.lang.String loggerName, java.lang.String subDir)
          Return the Hackystat Logger named with loggerName, creating it if it does not yet exist.
static java.util.logging.Logger getLogger(java.lang.String loggerName, java.lang.String subDir, boolean hasConsole)
          Return the Hackystat Logger named with loggerName, creating it if it does not yet exist.
static void setLoggingLevel(java.util.logging.Logger logger, java.lang.String level)
          Sets the logging level to be used for this Hackystat logger.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLogger

public static java.util.logging.Logger getLogger(java.lang.String loggerName)
Return the Hackystat Logger named with loggerName, creating it if it does not yet exist. Hackystat loggers have the following characteristics:

Parameters:
loggerName - The name of this HackystatLogger.
Returns:
The Logger instance.

getLogger

public static java.util.logging.Logger getLogger(java.lang.String loggerName,
                                                 java.lang.String subDir)
Return the Hackystat Logger named with loggerName, creating it if it does not yet exist. Hackystat loggers have the following characteristics:

Parameters:
loggerName - The name of this HackystatLogger.
subDir - The .hackystat subdirectory in which the log/ directory should be put.
Returns:
The Logger instance.

getLogger

public static java.util.logging.Logger getLogger(java.lang.String loggerName,
                                                 java.lang.String subDir,
                                                 boolean hasConsole)
Return the Hackystat Logger named with loggerName, creating it if it does not yet exist. Hackystat loggers have the following characteristics:

Parameters:
loggerName - The name of this HackystatLogger.
subDir - The .hackystat subdirectory in which the log/ directory should be put.
hasConsole - If true, then a ConsoleHandler is created.
Returns:
The Logger instance.

setLoggingLevel

public static void setLoggingLevel(java.util.logging.Logger logger,
                                   java.lang.String level)
Sets the logging level to be used for this Hackystat logger. If the passed string cannot be parsed into a Level, then INFO is set by default.

Parameters:
logger - The logger whose level is to be set.
level - The new Level.