Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| ABLE 2.3.0 07/13/2005 14:21:00
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.ibm.able
Class AbleTraceLogger

    java.lang.Object
      com.ibm.able.AbleTraceLogger

All Implemented Interfaces:
  AbleLogger, com.ibm.logging.IRecordType, java.io.Serializable

public class AbleTraceLogger
extends java.lang.Object
implements AbleLogger

The AbleTraceLogger class records messages and traces programs. It wrapppers functions from the com.ibm.logging package to minimize the dependancy.

The log and trace design follows the pattern established by JLog available from IBM alphaWorks. This includes:

- `Able.MessageLog`, a global logger used to display translatable output to an end user.
- `Able.TraceLog`, a global logger used to display program trace output to a developer.
- Contstants for setting trace and message levels in the `Able` class.
- Static methods in the `Able` start, stop, and change the levels of the two provided handlers for console and file output.
- Bean trace capability, so that a bean can trace at its own unique level regardless of the level of the global trace logger `Able.TraceLog`.
- Static methods in this class, AbleTraceLogger, which are useful for applications wishing to provide additional handlers.

The two global loggers and any bean using bean level logging can be managed via static methods in the `Able` class. Static methods in this class are intended for use by those creating custom handlers or custom loggers.

The following code snippets have been extracted from `com.ibm.able.examples.AbleTraceLogDemo`.

         AbleDefaultAgent agent = new AbleDefaultAgent("Agent");
         Able.setTraceConsoleHandlerLevel(Able.TRC_HIGH); //starts trace console handler thread
         agent.init(); // call something, at trace high, console output appears

         // send text and exception data on the fly
         agent.getTraceLogger().text(Able.TRC_MEDIUM,"Medium trace also appears at High");
         Able.TraceLog.exception(Able.TRC_LOW,"com.ibm.able.examples.AbleTraceLogDemo","main",new Exception("Oops!"));

         Able.setTraceConsoleHandlerLevel(Able.TRC_LOW);
         // change the level, thread running
         agent.init(); // no trace output from init at low level

         Able.setTraceConsoleHandlerLevel(Able.TRC_NONE); // end the console handler thread
         // or
         Able.stopTraceLogging();  // end all handlers

If your application provides an instance of com.ibm.logging.Logger, you may substitute your logger for the loggers used by Able. The steps required to replace the global MessageLogger are:

1. Close any output devices used by the existing logger first.

                  Able.stopMessageLogging();

2. Construct an AbleTraceLogger based on your Logger.

                  Able.MessageLogger = new AbleTraceLogger(myLogger);

See Also:
  `for a list of trace and message types used by Able, as well as static methods used to manipulate the static trace and message loggers.`, `Logger`, Serialized Form

Field Summary
`protected com.ibm.logging.Logger` | `logger`
`static java.lang.String` | `MESSAGE_CONSOLE_HANDLER` A constant used as a name to add and remove a message console handler.
`static java.lang.String` | `MESSAGE_FILE_HANDLER` A constant used as a name to add and remove a message file handler.
`static java.lang.String` | `MESSAGE_JTEXTAREA_HANDLER` A constant used as a name to add and remove a message textarea handler.
`static java.util.Vector` | `MessageLogSeverityLabelsVector` A Vector of descriptions of each `MessageLogSeverityValuesVector`.
`static java.util.Vector` | `MessageLogSeverityValuesVector` A Vector of message severities consisting of: `Able.MSG_NONE` `Able.MSG_INFO` `Able.MSG_WARNING` `Able.MSG_ERROR`
`static java.lang.String` | `TRACE_BEAN_CONSOLE_HANDLER` A constant used as a name to add and remove a local bean trace console handler.
`static java.lang.String` | `TRACE_BEAN_FILE_HANDLER` A constant used as a name to add and remove a local bean trace file handler.
`static java.lang.String` | `TRACE_BEAN_JTEXTAREA_HANDLER` A constant used as a name to add and remove a local bean trace textarea handler.
`static java.lang.String` | `TRACE_CONSOLE_HANDLER` A constant used as a name to add and remove a trace console handler.
`static java.lang.String` | `TRACE_FILE_HANDLER` A constant used as a name to add and remove a trace file handler.
`static java.lang.String` | `TRACE_JTEXTAREA_HANDLER` A constant used as a name to add and remove a trace textarea handler.
`static java.util.Vector` | `TraceLogLevelLabelsVector` A Vector of descriptions of each `TraceLogLevelValuesVector`.
`static java.util.Vector` | `TraceLogLevelValuesVector` A Vector of trace levels consisting of: `Able.TRC_NONE` `Able.TRC_LOW` `Able.TRC_MEDIUM` `Able.TRC_HIGH`

Fields inherited from interface com.ibm.able.AbleLogger
`MSG_ERROR, MSG_INFO, MSG_NONE, MSG_UNSPECIFIED, MSG_WARNING, TRC_HIGH, TRC_HIGH_INFER, TRC_HIGH_PARSE, TRC_HIGH_RLST, TRC_LOW, TRC_LOW_INFER, TRC_LOW_PARSE, TRC_LOW_RLST, TRC_MEDIUM, TRC_MEDIUM_INFER, TRC_MEDIUM_PARSE, TRC_MEDIUM_RLST, TRC_NONE`

Fields inherited from interface com.ibm.logging.IRecordType
`TYPE_ALL, TYPE_API, TYPE_CALLBACK, TYPE_DEBUG_MAX, TYPE_DEBUG_MID, TYPE_DEBUG_MIN, TYPE_DEFAULT_MESSAGE, TYPE_DEFAULT_TRACE, TYPE_ENTRY, TYPE_ENTRY_EXIT, TYPE_ERR, TYPE_ERROR, TYPE_ERROR_EXC, TYPE_EXIT, TYPE_FATAL, TYPE_INFO, TYPE_INFORMATION, TYPE_LEVEL1, TYPE_LEVEL2, TYPE_LEVEL3, TYPE_MISC_DATA, TYPE_NONE, TYPE_OBJ_CREATE, TYPE_OBJ_DELETE, TYPE_PERF, TYPE_PRIVATE, TYPE_PUBLIC, TYPE_STATIC, TYPE_SVC, TYPE_WARN, TYPE_WARNING`

Constructor Summary
`AbleTraceLogger(com.ibm.logging.Logger theLogger)` Construct a Logger from an existing com.ibm.logging.Logger.
`AbleTraceLogger(java.lang.String theName, java.lang.String theDescription)` Construct a Trace Logger of the specified name and description.

Method Summary
`static java.lang.Object` | `addConsoleHandler(AbleLogger theLogger, java.lang.String handlerName, long level)` Add a `ConsoleHandler` to a logger.
`static java.lang.Object` | `addFileHandler(AbleLogger theLogger, java.lang.String handlerName, long level, java.lang.String filename)` Add a `FileHandler` to a logger.
`static java.lang.Object` | `addHandler(AbleLogger theLogger, java.lang.Object theHandler, long level)` Add a handler to a specific logger with a filter for the specified level.
`void` | `addHandler(java.lang.Object theHandler, long level)` Add a handler to this logger.
`void` | `entry(long type, java.lang.Object loggingClass, java.lang.String loggingMethod)` Log a method entry trace statement without parameters.
`void` | `entry(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.Object parm)` Log a method entry trace statement with one parameter.
`void` | `entry(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.Object[] parms)` Log a method entry trace statement with multiple parameters.
`void` | `exception(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.Throwable throwable)` Log an exception.
`void` | `exit(long type, java.lang.Object loggingClass, java.lang.String loggingMethod)` Log a method exit trace statement with no result.
`void` | `exit(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.Object result)` Log a method exit trace statement with a result.
`long` | `getConsoleLogLevel()` Returns the raw console logging level.
`int` | `getConsoleLogLevelAsInt()` Returns the index of the console logging level.
`java.lang.String` | `getFileLogFileName()` Returns the filename used for file logging.
`long` | `getFileLogLevel()` Returns the raw file logging level.
`int` | `getFileLogLevelAsInt()` Returns the index of the file logging level.
`static java.lang.Object` | `getHandler(AbleLogger theLogger, java.lang.String theHandlerName)` Get a handler from a logger.
`java.util.Enumeration` | `getHandlers()` Get an Enumeration of handlers from this logger.
`static AbleLogger` | `getMessageLogger(java.lang.String theName, java.lang.String theDescription)` Return a shared AbleTraceLogger configured for message logging based on the stored preferences.
`static AbleLogger` | `getTraceLogger(java.lang.String theName, java.lang.String theDescription)` Return a shared AbleTraceLogger configured for trace logging based on the stored preferences.
`static boolean` | `hasConsoleHandler(AbleLogger theLogger)` Indicates if a logger contains any ConsoleHandler.
`static boolean` | `hasFileHandler(AbleLogger theLogger)` Indicates if a logger contains any FileHandler.
`boolean` | `isBeanLogger()` Indicates if the logger is a bean logger; ie, not `Able.TraceLog` nor `Able.MessageLog`.
`boolean` | `isLogging()` Indicates whether statements are being logged.
`boolean` | `isMessageLogger()` Indicates if the logger is a message logger; ie, its output is intended for end-users and is translated.
`boolean` | `isTraceLogger()` Indicates if the logger is a trace logger; ie, its output is intended for developers and is untranslated.
`void` | `message(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.String key)` Log a translated message.
`void` | `message(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.String key, java.lang.Object[] parms)` Log a translated message with multiple substitution parameters.
`void` | `message(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.String key, java.lang.String parm)` Log a translated message with a single substitution parameter.
`static java.lang.Object` | `removeHandler(AbleLogger theLogger, java.lang.Object theHandler)`
`void` | `removeHandler(java.lang.Object theHandler)` Remove a handler from this logger.
`void` | `setConsoleLogLevel(long level)` Sets the raw console logging level.
`void` | `setFileLogLevel(long level)` Sets the raw file logging level.
`static void` | `setHandlerLevel(AbleLogger theLogger, java.lang.String name, long level)` Sets the logging level for a given handler by creating an AnyMaskFilter.
`static java.lang.Object` | `setHandlerLevel(java.lang.Object handler, long level)` Sets the logging level for a given handler by creating an AnyMaskFilter.
`void` | `setLogging(boolean isLogging)` Sets the flag determining whether logging is on or off.
`static void` | `setSimpleFormatter(java.lang.Object theHandler)` Add a simple formatter to provide minimal output.
`void` | `stackTrace(long type, java.lang.Object loggingClass, java.lang.String loggingMethod)` Log a stacktrace.
`static void` | `startHandler(java.lang.Object theHandler)` Start a handler's threads.
`static void` | `stopHandler(java.lang.Object theHandler)` Stop a handler's threads.
`static void` | `stopLogger(AbleLogger theLogger)` Stop a logger by removing all of its handlers and threads.
`void` | `text(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.String text)` Log an untranslated trace statement.
`void` | `text(long type, java.lang.Object loggingClass, java.lang.String loggingMethod, java.lang.String text, java.lang.Object[] parms)` Log an untranslated trace statement with substitution parameters.
`void` | `text(long type, java.lang.String text)` Log an untranslated trace statement.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### TRACE_CONSOLE_HANDLER

    public static final java.lang.String TRACE_CONSOLE_HANDLER

  A constant used as a name to add and remove a trace console handler.

  See Also:
    Constant Field Values

### TRACE_FILE_HANDLER

    public static final java.lang.String TRACE_FILE_HANDLER

  A constant used as a name to add and remove a trace file handler.

  See Also:
    Constant Field Values

### TRACE_JTEXTAREA_HANDLER

    public static final java.lang.String TRACE_JTEXTAREA_HANDLER

  A constant used as a name to add and remove a trace textarea handler.

  See Also:
    Constant Field Values

### TRACE_BEAN_CONSOLE_HANDLER

    public static final java.lang.String TRACE_BEAN_CONSOLE_HANDLER

  A constant used as a name to add and remove a local bean trace console handler.

  See Also:
    Constant Field Values

### TRACE_BEAN_FILE_HANDLER

    public static final java.lang.String TRACE_BEAN_FILE_HANDLER

  A constant used as a name to add and remove a local bean trace file handler.

  See Also:
    Constant Field Values

### TRACE_BEAN_JTEXTAREA_HANDLER

    public static final java.lang.String TRACE_BEAN_JTEXTAREA_HANDLER

  A constant used as a name to add and remove a local bean trace textarea handler.

  See Also:
    Constant Field Values

### MESSAGE_CONSOLE_HANDLER

    public static final java.lang.String MESSAGE_CONSOLE_HANDLER

  A constant used as a name to add and remove a message console handler.

  See Also:
    Constant Field Values

### MESSAGE_FILE_HANDLER

    public static final java.lang.String MESSAGE_FILE_HANDLER

  A constant used as a name to add and remove a message file handler.

  See Also:
    Constant Field Values

### MESSAGE_JTEXTAREA_HANDLER

    public static final java.lang.String MESSAGE_JTEXTAREA_HANDLER

  A constant used as a name to add and remove a message textarea handler.

  See Also:
    Constant Field Values

### TraceLogLevelValuesVector

    public static final java.util.Vector TraceLogLevelValuesVector

  A Vector of trace levels consisting of:
  - `Able.TRC_NONE`
  - `Able.TRC_LOW`
  - `Able.TRC_MEDIUM`
  - `Able.TRC_HIGH`

### TraceLogLevelLabelsVector

    public static final java.util.Vector TraceLogLevelLabelsVector

  A Vector of descriptions of each `TraceLogLevelValuesVector`.

### MessageLogSeverityValuesVector

    public static final java.util.Vector MessageLogSeverityValuesVector

  A Vector of message severities consisting of:
  - `Able.MSG_NONE`
  - `Able.MSG_INFO`
  - `Able.MSG_WARNING`
  - `Able.MSG_ERROR`

### MessageLogSeverityLabelsVector

    public static final java.util.Vector MessageLogSeverityLabelsVector

  A Vector of descriptions of each `MessageLogSeverityValuesVector`.

### logger

    protected transient com.ibm.logging.Logger logger

Constructor Detail

### AbleTraceLogger

    public AbleTraceLogger(java.lang.String theName,
                           java.lang.String theDescription)

  Construct a Trace Logger of the specified name and description. Only loggers for trace use can be constructed as only one static logger for messages is supported.

Parameters:
  `theName` - The name of the logger.
  `theDescription` - The description of the logger.

### AbleTraceLogger

    public AbleTraceLogger(com.ibm.logging.Logger theLogger)

  Construct a Logger from an existing com.ibm.logging.Logger. of the specified name and description. If the logger provided as source is a com.ibm.logging.TraceLogger, the type is TRACE. Loggers constructed by copying are by definition shared loggers rather than bean loggers.

Parameters:
  `theLogger` - The source logger, which must not be null.

Method Detail

### getTraceLogger

    public static AbleLogger getTraceLogger(java.lang.String theName,
                                            java.lang.String theDescription)

  Return a shared AbleTraceLogger configured for trace logging based on the stored preferences. Handlers are added when the logger is started.

  Parameters:
    `theName` - A String containing the name for the logger.
    `theDescription` - A String containing the logger's description.
  Returns:
    An AbleTraceLogger configured for trace logging.

### getMessageLogger

    public static AbleLogger getMessageLogger(java.lang.String theName,
                                              java.lang.String theDescription)

  Return a shared AbleTraceLogger configured for message logging based on the stored preferences. Handlers are added when the logger is started.

  Parameters:
    `theName` - A String containing the name for the logger.
    `theDescription` - The logger's description.
  Returns:
    An AbleTraceLogger configured for message logging.

### addConsoleHandler

    public static java.lang.Object addConsoleHandler(AbleLogger theLogger,
                                                     java.lang.String handlerName,
                                                     long level)

  Add a `ConsoleHandler` to a logger. If a handler by the name provided exists, all its filters are removed and a new AnyMaskFilter is calculated from the level.

  Parameters:
    `theLogger` - The logger instance to use the new handler.
    `handlerName` - The name of the handler to add.
    `level` - A level used to calculate the mask for an `AnyMaskFilter`.
  Returns:
    The ConsoleHandler with the name provided.

### addFileHandler

    public static java.lang.Object addFileHandler(AbleLogger theLogger,
                                                  java.lang.String handlerName,
                                                  long level,
                                                  java.lang.String filename)

  Add a `FileHandler` to a logger. If a handler by the name provided exists, all its filters are removed and a new AnyMaskFilter is calculated from the level. If Able.Debug is true, the AbleTraceFormatter is used to display output.

  Parameters:
    `theLogger` - The logger instance to use the new handler.
    `handlerName` - A String containing the name of the handler to add.
    `level` - A level used to calculate the mask for an `AnyMaskFilter`.
    `filename` - A String containing the path and file name.
  Returns:
    The FileHandler with the name provided.

### addHandler

    public static java.lang.Object addHandler(AbleLogger theLogger,
                                              java.lang.Object theHandler,
                                              long level)

  Add a handler to a specific logger with a filter for the specified level. Exisitng filters are removed from the handler and a new AnyMaskFilter is calculated from the level.

  Parameters:
    `theLogger` - The logger instance to use the new handler.
    `theHandler` - The handler to add.
    `level` - A level used to calculate the mask for an `AnyMaskFilter`.
  Returns:
    The handler as modified.

### setSimpleFormatter

    public static void setSimpleFormatter(java.lang.Object theHandler)

  Add a simple formatter to provide minimal output.

  Parameters:
    `theHandler` - The IHandler instance to use the formatter. If null, no action is taken.

### getConsoleLogLevel

    public long getConsoleLogLevel()

  Returns the raw console logging level.

  Specified by:
    `getConsoleLogLevel` in interface `AbleLogger`
  Returns:
    The logging level.

### setConsoleLogLevel

    public void setConsoleLogLevel(long level)

  Sets the raw console logging level. Ignored if no console handler.

  Specified by:
    `setConsoleLogLevel` in interface `AbleLogger`
  Parameters:
    `level` - A long indicating the logging trace level or message severity.

### getFileLogLevel

    public long getFileLogLevel()

  Returns the raw file logging level.

  Specified by:
    `getFileLogLevel` in interface `AbleLogger`
  Returns:
    The logging level.

### setFileLogLevel

    public void setFileLogLevel(long level)

  Sets the raw file logging level. Ignored if no file handler.

  Specified by:
    `setFileLogLevel` in interface `AbleLogger`
  Parameters:
    `level` -

### getFileLogFileName

    public java.lang.String getFileLogFileName()

  Returns the filename used for file logging.

  Specified by:
    `getFileLogFileName` in interface `AbleLogger`
  Returns:
    The file name.

### getConsoleLogLevelAsInt

    public int getConsoleLogLevelAsInt()

  Returns the index of the console logging level.

  Returns:
    The index of the logging level.

### getFileLogLevelAsInt

    public int getFileLogLevelAsInt()

  Returns the index of the file logging level.

  Returns:
    The index of the logging level.

### removeHandler

    public static java.lang.Object removeHandler(AbleLogger theLogger,
                                                 java.lang.Object theHandler)

### stopHandler

    public static void stopHandler(java.lang.Object theHandler)

  Stop a handler's threads.

### startHandler

    public static void startHandler(java.lang.Object theHandler)

  Start a handler's threads.

### stopLogger

    public static void stopLogger(AbleLogger theLogger)

  Stop a logger by removing all of its handlers and threads.

### hasConsoleHandler

    public static boolean hasConsoleHandler(AbleLogger theLogger)

  Indicates if a logger contains any ConsoleHandler.

  Parameters:
    `theLogger` - A logger instance which potentially contains the name of the logger.
  Returns:
    `true` if the logger has a console handler, `false` otherwise.

### hasFileHandler

    public static boolean hasFileHandler(AbleLogger theLogger)

  Indicates if a logger contains any FileHandler.

  Parameters:
    `theLogger` - The logger instance containing the handler to be removed.
  Returns:
    A boolean indicating whether the logger has a file handler.

### setHandlerLevel

    public static java.lang.Object setHandlerLevel(java.lang.Object handler,
                                                   long level)

  Sets the logging level for a given handler by creating an AnyMaskFilter. The logging level will not be changed if the handler provided is either the console or file handler with the static Able.MessageLog or Able.TraceLog loggers.

  Parameters:
    `handler` - A console or file handler on which to add the filter.
    `level` - A value used to create the mask for the filter.
  Returns:
    An AnyMaskFilter object, null if the handler's level is not set.
  See Also:
    `AnyMaskFilter`

### setHandlerLevel

    public static void setHandlerLevel(AbleLogger theLogger,
                                       java.lang.String name,
                                       long level)

  Sets the logging level for a given handler by creating an AnyMaskFilter.

  Parameters:
    `theLogger` - The logger on which to change the handler level.
    `name` - The name of the handler on which to add the filter.
    `level` - A value used to create the mask for the filter.
  See Also:
    `AnyMaskFilter`

### isLogging

    public boolean isLogging()

  Indicates whether statements are being logged.

  Specified by:
    `isLogging` in interface `AbleLogger`

### setLogging

    public void setLogging(boolean isLogging)

  Sets the flag determining whether logging is on or off.

  Specified by:
    `setLogging` in interface `AbleLogger`
  Parameters:
    `isLogging` - `true` if logging is onl `false` otherwise.

### message

    public void message(long type,
                        java.lang.Object loggingClass,
                        java.lang.String loggingMethod,
                        java.lang.String key)

  Log a translated message.

  Specified by:
    `message` in interface `AbleLogger`
  Parameters:
    `type` - A message record type.
    `loggingClass` - An instance of a class (this), or a String containing the package and name if static.
    `loggingMethod` - A string containing the name of the method.
    `key` - The key used to obtain the translated message from the resource bundle.
  See Also:
    `Able.MSG_ERROR`, `Able.MSG_WARNING`, `Able.MSG_INFO`, `Logger.message(long, java.lang.Object, java.lang.String, java.lang.String)`

### message

    public void message(long type,
                        java.lang.Object loggingClass,
                        java.lang.String loggingMethod,
                        java.lang.String key,
                        java.lang.String parm)

  Log a translated message with a single substitution parameter.

  Specified by:
    `message` in interface `AbleLogger`
  Parameters:
    `type` - A message record type.
    `loggingClass` - An instance of a class (this), or a String containing the package and name if static.
    `loggingMethod` - A string containing the name of the method.
    `key` - The key used to obtain the translated message from the resource bundle.
    `parm` - A substitution value to be inserted into the message.
  See Also:
    `Able.MSG_ERROR`, `Able.MSG_WARNING`, `Able.MSG_INFO`, `Logger.message(long, java.lang.Object, java.lang.String, java.lang.String)`

### message

    public void message(long type,
                        java.lang.Object loggingClass,
                        java.lang.String loggingMethod,
                        java.lang.String key,
                        java.lang.Object[] parms)

  Log a translated message with multiple substitution parameters.

  Specified by:
    `message` in interface `AbleLogger`
  Parameters:
    `type` - A message record type.
    `loggingClass` - An instance of a class (this), or a String containing the package and name if static.
    `loggingMethod` - A string containing the name of the method.
    `key` - The key used to obtain the translated message from the resource bundle.
    `parms` - A array of substitution values to be inserted into the message.
  See Also:
    `Able.MSG_ERROR`, `Able.MSG_WARNING`, `Able.MSG_INFO`, `Logger.message(long, java.lang.Object, java.lang.String, java.lang.String, java.lang.Object[])`

### stackTrace

    public void stackTrace(long type,
                           java.lang.Object loggingClass,
                           java.lang.String loggingMethod)

  Log a stacktrace.

  Specified by:
    `stackTrace` in interface `AbleLogger`
  Parameters:
    `type` - A message record type.
    `loggingClass` - An instance of a class (this), or a String containing the package and name if static.
    `loggingMethod` - A string containing the name of the method.
  See Also:
    `Able.TRC_LOW`, `Able.TRC_MEDIUM`, `Able.TRC_HIGH`, `Logger.stackTrace(long,Object,String)`

### text

    public void text(long type,
                     java.lang.String text)

  Log an untranslated trace statement. The Class and Method are null and the empty string respectively.

  Specified by:
    `text` in interface `AbleLogger`
  Parameters:
    `type` - A trace record type.
    `text` - The text to be logged.
  See Also:
    `Logger.text(long,Object,String,String)`

### text

    public void text(long type,
                     java.lang.Object loggingClass,
                     java.lang.String loggingMethod,
                     java.lang.String text)

  Log an untranslated trace statement.

  Specified by:
    `text` in interface `AbleLogger`
  Parameters:
    `type` - A trace record type.
    `loggingClass` - An instance of a class (this), or a String containing the package and name if static.
    `loggingMethod` - A string containing the name of the method.
    `text` - The text to be logged.
  See Also:
    `Able.TRC_LOW`, `Able.TRC_MEDIUM`, `Able.TRC_HIGH`, `Logger.text(long,Object,String,String)`

### text

    public void text(long type,
                     java.lang.Object loggingClass,
                     java.lang.String loggingMethod,
                     java.lang.String text,
                     java.lang.Object[] parms)

  Log an untranslated trace statement with substitution parameters.

  Specified by:
    `text` in interface `AbleLogger`
  Parameters:
    `type` - A trace record type.
    `loggingClass` - An instance of a class (this), or a String containing the package and name if static.
    `loggingMethod` - A string containing the name of the method.
    `text` - The text to be logged.
    `parms` - The array of substitution values to be inserted into the text.
  See Also:
    `Able.TRC_LOW`, `Able.TRC_MEDIUM`, `Able.TRC_HIGH`, `Logger.text(long,Object,String,String,Object[])`

### entry

    public void entry(long type,
                      java.lang.Object loggingClass,
                      java.lang.String loggingMethod)

  Log a method entry trace statement without parameters.

  Specified by:
    `entry` in interface `AbleLogger`
  Parameters:
    `type` - A trace record type.
    `loggingClass` - An instance of a class (this), or a String containing the package and name if static.
    `loggingMethod` - A string containing the name of the method.
  See Also:
    `Able.TRC_LOW`, `Able.TRC_MEDIUM`, `Able.TRC_HIGH`, `Logger.entry(long,Object,String)`

### entry

    public void entry(long type,
                      java.lang.Object loggingClass,
                      java.lang.String loggingMethod,
                      java.lang.Object parm)

  Log a method entry trace statement with one parameter.

  Specified by:
    `entry` in interface `AbleLogger`
  Parameters:
    `type` - A trace record type.
    `loggingClass` - An instance of a class (this), or a String containing the package and name if static.
    `loggingMethod` - A string containing the name of the method.
    `parm` - The object provided in the method's argument list.
  See Also:
    `Able.TRC_LOW`, `Able.TRC_MEDIUM`, `Able.TRC_HIGH`, `Logger.entry(long,Object,String,Object)`

### entry

    public void entry(long type,
                      java.lang.Object loggingClass,
                      java.lang.String loggingMethod,
                      java.lang.Object[] parms)

  Log a method entry trace statement with multiple parameters.

  Specified by:
    `entry` in interface `AbleLogger`
  Parameters:
    `type` - A trace record type.
    `loggingClass` - An instance of a class (this), or a String containing the package and name if static.
    `loggingMethod` - A string containing the name of the method.
    `parms` - The objects provided in the method's argument list.
  See Also:
    `Able.TRC_LOW`, `Able.TRC_MEDIUM`, `Able.TRC_HIGH`, `Logger.entry(long,Object,String,Object[])`

### exception

    public void exception(long type,
                          java.lang.Object loggingClass,
                          java.lang.String loggingMethod,
                          java.lang.Throwable throwable)

  Log an exception.

  Specified by:
    `exception` in interface `AbleLogger`
  Parameters:
    `type` - A trace record type.
    `loggingClass` - An instance of a class (this), or a String containing the package and name if static.
    `loggingMethod` - A string containing the name of the method.
    `throwable` - The exception.
  See Also:
    `Able.TRC_LOW`, `Able.TRC_MEDIUM`, `Able.TRC_HIGH`, `Logger.exception(long,Object,String,Throwable)`

### exit

    public void exit(long type,
                     java.lang.Object loggingClass,
                     java.lang.String loggingMethod)

  Log a method exit trace statement with no result.

  Specified by:
    `exit` in interface `AbleLogger`
  Parameters:
    `type` - A trace record type.
    `loggingClass` - An instance of a class (this), or a String containing the package and name if static.
    `loggingMethod` - A string containing the name of the method.
  See Also:
    `Able.TRC_LOW`, `Able.TRC_MEDIUM`, `Able.TRC_HIGH`, `Logger.exit(long,Object,String)`

### exit

    public void exit(long type,
                     java.lang.Object loggingClass,
                     java.lang.String loggingMethod,
                     java.lang.Object result)

  Log a method exit trace statement with a result.

  Specified by:
    `exit` in interface `AbleLogger`
  Parameters:
    `type` - A trace record type.
    `loggingClass` - An instance of a class (this), or a String containing the package and name if static.
    `loggingMethod` - A string containing the name of the method.
    `result` - The result of the method.
  See Also:
    `Able.TRC_LOW`, `Able.TRC_MEDIUM`, `Able.TRC_HIGH`, `Logger.exit(long,Object,String,Object)`

### addHandler

    public void addHandler(java.lang.Object theHandler,
                           long level)

  Add a handler to this logger. Only IHandler implementers are currently supported.

  Specified by:
    `addHandler` in interface `AbleLogger`
  Parameters:
    `theHandler` - The handler to add.
    `level` - The level to log.
  See Also:
    `LoggerCfg.addHandler(IHandler)`

### removeHandler

    public void removeHandler(java.lang.Object theHandler)

  Remove a handler from this logger. Only IHandler implementers are currently supported. Since handlers may be shared, it is not stopped.

  Specified by:
    `removeHandler` in interface `AbleLogger`
  Parameters:
    `theHandler` - The handler to remove.
  See Also:
    `LoggerCfg.removeHandler(IHandler)`

### getHandlers

    public java.util.Enumeration getHandlers()

  Get an Enumeration of handlers from this logger.

  Specified by:
    `getHandlers` in interface `AbleLogger`
  Returns:
    An Enumeration of handlers, which may be null if the logger has not been created.
  See Also:
    `LoggerCfg.getHandlers()`

### getHandler

    public static java.lang.Object getHandler(AbleLogger theLogger,
                                              java.lang.String theHandlerName)

  Get a handler from a logger. If the handler is not found, nothing happens.

  Parameters:
    `theLogger` - The logger instance containing the handler to be removed.
    `theHandlerName` - A String containing the name of the handler to remove.
  See Also:
    `TRACE_CONSOLE_HANDLER`, `TRACE_FILE_HANDLER`, `MESSAGE_CONSOLE_HANDLER`, `MESSAGE_FILE_HANDLER`

### isBeanLogger

    public boolean isBeanLogger()

  Indicates if the logger is a bean logger; ie, not `Able.TraceLog` nor `Able.MessageLog`.

  Specified by:
    `isBeanLogger` in interface `AbleLogger`
  Returns:
    `true` if the logger is a bean logger; `false` otherwise.

### isTraceLogger

    public boolean isTraceLogger()

  Indicates if the logger is a trace logger; ie, its output is intended for developers and is untranslated.

  Specified by:
    `isTraceLogger` in interface `AbleLogger`
  Returns:
    `true` if the logger is a trace logger; `false` otherwise.

### isMessageLogger

    public boolean isMessageLogger()

  Indicates if the logger is a message logger; ie, its output is intended for end-users and is translated.

  Returns:
    `true` if the logger is a message logger; `false` otherwise.

Overview | Package | Class | Use | Tree | Serialized | Deprecated | Index | Help
| ABLE 2.3.0 07/13/2005 14:21:00
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

(C) Copyright IBM Corporation 1999, 2005