electric.util.log
Class Log

java.lang.Object
  extended byelectric.util.log.Log

public final class Log
extends java.lang.Object

Log defines static methods for maintaining a collection of ILoggers and sending an event to all of them. The collection is initialized to a single default logger that logs ERROR and COMMENT events to System.out.

Author:
webMethods

Constructor Summary
Log()
           
 
Method Summary
static void addLogger(java.lang.String name, ILogger logger)
          Add the specified logger to my collection of loggers.
static void disableLogger(java.lang.String name)
          Disable the specified logger from my collection of loggers.
static void enableLogger(java.lang.String name)
          Reenable the specified logger in my collection of loggers.
static java.util.Enumeration getCategories()
          Return all registered logging categories
static java.lang.String getCategory(long code)
          Return the category associated with the specified code.
static long getCode(java.lang.String category)
          Return the code for the specified category.
static java.util.Hashtable getExplicitLogging()
           
static ILogger getLogger(java.lang.String name)
          Returns a logger with the specified logger name.
static java.util.Enumeration getLoggerNames()
          Return an enumeration over all the current logger names.
static java.util.Enumeration getLoggers()
          Return an enumeration over all the current loggers.
static boolean isLogging(long mask)
          Return true if at least one of the loggers is logging a category defined by the mask.
static boolean isLogging(java.lang.String category)
          Return true if at least one of the loggers is logging the specified category.
static void log(long code, java.lang.Object event)
          Send event( category, message ) to each logger that is logging the specified category.
static void log(long code, java.lang.String message, java.lang.Throwable throwable)
           
static void log(long code, java.lang.Throwable throwable)
           
static void log(java.lang.Object event)
          Log the event with category "COMMENT".
static void log(java.lang.String category, java.lang.Object event)
          Send event( category, message ) to each logger that is logging the specified category.
static void log(java.lang.String category, java.lang.Throwable throwable)
           
static void logComment(java.lang.String message)
           
static void logException(java.lang.String message, java.lang.Throwable throwable)
          Log the event with category "EXCEPTION_EVENT".
static void logException(java.lang.Throwable throwable)
          Log the event with category "EXCEPTION_EVENT".
static void logWarning(java.lang.String message)
           
static void removeLogger(java.lang.String name)
          Remove the specified logger from my collection of loggers.
static void startLogging(long code)
          Instruct all loggers to start logging events of the specified category.
static void startLogging(java.lang.String category)
          Instruct all loggers to start logging events of the specified category.
static void stopLogging(long code)
           
static void stopLogging(java.lang.String category)
          Instruct all loggers to stop logging events of the specified category.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Log

public Log()
Method Detail

isLogging

public static boolean isLogging(long mask)
Return true if at least one of the loggers is logging a category defined by the mask.

Parameters:
mask - The mask.

isLogging

public static boolean isLogging(java.lang.String category)
Return true if at least one of the loggers is logging the specified category.

Parameters:
category - The category.

getCode

public static long getCode(java.lang.String category)
Return the code for the specified category.

Parameters:
category - The category.

getCategory

public static java.lang.String getCategory(long code)
Return the category associated with the specified code.

Parameters:
code - The code.

getLogger

public static ILogger getLogger(java.lang.String name)
Returns a logger with the specified logger name.

Parameters:
name - The name of the logger
Returns:
named logger or null if no logger is mapped to the name

addLogger

public static void addLogger(java.lang.String name,
                             ILogger logger)
Add the specified logger to my collection of loggers.

Parameters:
name - The name of the logger.
logger - The logger to add.

removeLogger

public static void removeLogger(java.lang.String name)
Remove the specified logger from my collection of loggers.

Parameters:
name - The name of the logger.

disableLogger

public static void disableLogger(java.lang.String name)
Disable the specified logger from my collection of loggers.

Parameters:
name - The name of the logger.

enableLogger

public static void enableLogger(java.lang.String name)
Reenable the specified logger in my collection of loggers.

Parameters:
name - The name of the logger.

getLoggers

public static java.util.Enumeration getLoggers()
Return an enumeration over all the current loggers.


getLoggerNames

public static java.util.Enumeration getLoggerNames()
Return an enumeration over all the current logger names.


getExplicitLogging

public static java.util.Hashtable getExplicitLogging()

startLogging

public static void startLogging(long code)
Instruct all loggers to start logging events of the specified category.

Parameters:
code - The code of the category.

startLogging

public static void startLogging(java.lang.String category)
Instruct all loggers to start logging events of the specified category.

Parameters:
category - The category.

stopLogging

public static void stopLogging(long code)
Parameters:
code -

stopLogging

public static void stopLogging(java.lang.String category)
Instruct all loggers to stop logging events of the specified category.

Parameters:
category - The category.

getCategories

public static java.util.Enumeration getCategories()
Return all registered logging categories


log

public static void log(java.lang.Object event)
Log the event with category "COMMENT". This is equivalent to log( COMMENT_EVENT, event );

Parameters:
event - The event.

log

public static void log(java.lang.String category,
                       java.lang.Throwable throwable)
Parameters:
category -
throwable -

log

public static void log(long code,
                       java.lang.Throwable throwable)
Parameters:
code -
throwable -

log

public static void log(long code,
                       java.lang.String message,
                       java.lang.Throwable throwable)
Parameters:
code -
message -
throwable -

log

public static void log(java.lang.String category,
                       java.lang.Object event)
Send event( category, message ) to each logger that is logging the specified category.

Parameters:
category - The category.
event - The event to log.

log

public static void log(long code,
                       java.lang.Object event)
Send event( category, message ) to each logger that is logging the specified category.

Parameters:
code - The category code.
event - The event to log.

logException

public static void logException(java.lang.Throwable throwable)
Log the event with category "EXCEPTION_EVENT". This is equivalent to log( EXCEPTION_EVENT, "error", throwable );

Parameters:
throwable - The exception.

logException

public static void logException(java.lang.String message,
                                java.lang.Throwable throwable)
Log the event with category "EXCEPTION_EVENT". This is equivalent to log( EXCEPTION_EVENT, throwable );

Parameters:
message - The message
throwable - The exception.

logComment

public static void logComment(java.lang.String message)
Parameters:
message -

logWarning

public static void logWarning(java.lang.String message)
Parameters:
message -


copyright© 2001-2004 by webMethods All Rights Reserved.