com.ibm.di.plugin.idipwsync
Class IDIPasswordStoreTrace

java.lang.Object
  extended by com.ibm.di.plugin.idipwsync.IDIPasswordStoreTrace

public class IDIPasswordStoreTrace
extends Object

This class Provides a general purpose logging facility. It is currently a wrapper class for much of the functionality provided by CSA's UtTrace facility. The default logging destination is System.out. Trace data may be redirected to a file, or to an instance of java.io.OutputStream supplied by the application. In addition to the default log, any number of named logs may be defined. All trace data is written to the default log, but named logs provide a way to isolate trace data for a particular function in a separate log. The logging destination for each named log is controlled separately from the default log.

There are four categories of trace data. Each category may be active or inactive independently of the others.

Information - Used to provide status information for programmers.

Diagnostic - Used to log object state information and flow of control through the code.

Warning - Used to log recoverable errors. This category supports logging of stack traces.

Error - Used to log unrecoverable errors. This category supports logging of stack traces.


Field Summary
static String DEFAULT_LOG_FILENAME
           
static int DIAGNOSTIC
           
static String DIAGTRACE
           
static int ERROR
           
static String ERRTRACE
           
static int INFORMATION
           
static String INFOTRACE
           
static int WARNING
           
static String WARNTRACE
           
 
Constructor Summary
IDIPasswordStoreTrace()
           
 
Method Summary
static void AssertInitialized(String logFile, int debug)
           
static boolean isDiagnosticTraceEnabled()
          Indicates whether diagnostic messages are logged.
static boolean isErrorTraceEnabled()
          Indicates whether error messages are logged.
static boolean isInformationTraceEnabled()
          Indicates whether information messages are logged.
static boolean isInitialized()
           
static boolean isWarningTraceEnabled()
          Indicates whether warning messages are logged.
static void logDiagnostic(String message)
          Logs a diagnostic message to the default log.
static void logDiagnostic(String message, Object logfile)
          Logs a diagnostic message to the specified log.
static void logError(String message)
          Logs an error message to the default log.
static void logError(String message, Object logfile)
          Logs an error message to the specified log.
static void logError(String message, Throwable excep)
          Logs an error message and an exception to the default log as an error.
static void logError(String message, Throwable excep, Object logfile)
          Logs an error message and an exception to the specified log as an error.
static void logError(Throwable excep)
          Logs an error message to the default log.
static void logError(Throwable excep, Object logfile)
          Logs an exception to the specified log as an error.
static void logInformation(String message)
          Logs an information message to the default log.
static void logInformation(String message, Object logfile)
          Logs an information message to the specified log.
static void logWarning(String message)
          Logs a warning message to the default log.
static void logWarning(String message, Object logfile)
          Logs a warning message to the specified log.
static void logWarning(String message, Throwable excep)
          Logs a warning message and an exception to the default log as a warning.
static void logWarning(String message, Throwable excep, Object logfile)
          Logs a warning message and an exception to the specified log as a warning.
static void logWarning(Throwable excep)
          Logs an exception to the default log as a warning.
static void logWarning(Throwable excep, Object logfile)
          Logs an exception to the specified log as a warning.
static void setDiagnosticTraceEnabled(boolean b)
          if b is true, Diagnostic tracing is enabled
static void setErrorTraceEnabled(boolean b)
          if b is true, Error tracing is enabled
static void setInformationTraceEnabled(boolean b)
          if b is true, Information tracing is enabled
static void setInitialized(boolean b)
           
static void setLogFileName(String filename)
          Sets filename for default log file.
static void setWarningTraceEnabled(boolean b)
          if b is true, Warning tracing is enabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DIAGTRACE

public static final String DIAGTRACE
See Also:
Constant Field Values

INFOTRACE

public static final String INFOTRACE
See Also:
Constant Field Values

ERRTRACE

public static final String ERRTRACE
See Also:
Constant Field Values

WARNTRACE

public static final String WARNTRACE
See Also:
Constant Field Values

DEFAULT_LOG_FILENAME

public static final String DEFAULT_LOG_FILENAME
See Also:
Constant Field Values

WARNING

public static final int WARNING
See Also:
Constant Field Values

ERROR

public static final int ERROR
See Also:
Constant Field Values

DIAGNOSTIC

public static final int DIAGNOSTIC
See Also:
Constant Field Values

INFORMATION

public static final int INFORMATION
See Also:
Constant Field Values
Constructor Detail

IDIPasswordStoreTrace

public IDIPasswordStoreTrace()
Method Detail

AssertInitialized

public static void AssertInitialized(String logFile,
                                     int debug)
                              throws IOException
Throws:
IOException

isDiagnosticTraceEnabled

public static boolean isDiagnosticTraceEnabled()
Indicates whether diagnostic messages are logged.

Returns:
true if diagnostic tracing is enabled; false otherwise.

isErrorTraceEnabled

public static boolean isErrorTraceEnabled()
Indicates whether error messages are logged.

Returns:
true if error tracing is enabled; false otherwise.

isInformationTraceEnabled

public static boolean isInformationTraceEnabled()
Indicates whether information messages are logged.

Returns:
true if information tracing is enabled; false otherwise.

isInitialized

public static boolean isInitialized()

isWarningTraceEnabled

public static boolean isWarningTraceEnabled()
Indicates whether warning messages are logged.

Returns:
true if warning tracing is enabled; false otherwise.

logDiagnostic

public static void logDiagnostic(String message)
Logs a diagnostic message to the default log.

Parameters:
message - The message string to log.

logDiagnostic

public static void logDiagnostic(String message,
                                 Object logfile)
Logs a diagnostic message to the specified log.

Parameters:
message - The message string to log.
logfile - The name of the log to which the message should be logged.

logError

public static void logError(String message)
Logs an error message to the default log.

Parameters:
message - The message string to log.

logError

public static void logError(String message,
                            Object logfile)
Logs an error message to the specified log.

Parameters:
message - The message string to log.
logfile - The name of the log to which the message should be logged.

logError

public static void logError(String message,
                            Throwable excep)
Logs an error message and an exception to the default log as an error.

Parameters:
message - The message string to log.
excep - java.lang.Throwable to log.

logError

public static void logError(String message,
                            Throwable excep,
                            Object logfile)
Logs an error message and an exception to the specified log as an error.

Parameters:
message - The message string to log.
excep - java.lang.Throwable to log.
logfile - The name of the log to which the message should be logged.

logError

public static void logError(Throwable excep)
Logs an error message to the default log.

Parameters:
excep - java.lang.Throwable to log.

logError

public static void logError(Throwable excep,
                            Object logfile)
Logs an exception to the specified log as an error.

Parameters:
excep - java.lang.Throwable to log.
logfile - The name of the log to which the message should be logged.

logInformation

public static void logInformation(String message)
Logs an information message to the default log.

Parameters:
message - The message string to log.

logInformation

public static void logInformation(String message,
                                  Object logfile)
Logs an information message to the specified log.

Parameters:
message - The message string to log.
logfile - The name of the log to which the message should be logged.

logWarning

public static void logWarning(String message)
Logs a warning message to the default log.

Parameters:
message - The message string to log.

logWarning

public static void logWarning(String message,
                              Object logfile)
Logs a warning message to the specified log.

Parameters:
message - The message string to log.
logfile - The name of the log to which the message should be logged.

logWarning

public static void logWarning(String message,
                              Throwable excep)
Logs a warning message and an exception to the default log as a warning.

Parameters:
message - The message string to log.
excep - java.lang.Throwable to log.

logWarning

public static void logWarning(String message,
                              Throwable excep,
                              Object logfile)
Logs a warning message and an exception to the specified log as a warning.

Parameters:
message - The message string to log.
excep - java.lang.Throwable to log.
logfile - The name of the log to which the message should be logged.

logWarning

public static void logWarning(Throwable excep)
Logs an exception to the default log as a warning.

Parameters:
excep - java.lang.Throwable to log.

logWarning

public static void logWarning(Throwable excep,
                              Object logfile)
Logs an exception to the specified log as a warning.

Parameters:
excep - java.lang.Throwable to log.
logfile - The name of the log to which the message should be logged.

setDiagnosticTraceEnabled

public static void setDiagnosticTraceEnabled(boolean b)
if b is true, Diagnostic tracing is enabled


setErrorTraceEnabled

public static void setErrorTraceEnabled(boolean b)
if b is true, Error tracing is enabled


setInformationTraceEnabled

public static void setInformationTraceEnabled(boolean b)
if b is true, Information tracing is enabled


setInitialized

public static void setInitialized(boolean b)

setLogFileName

public static void setLogFileName(String filename)
                           throws IOException
Sets filename for default log file. Throws IOException if if has problems finding the file

Throws:
IOException

setWarningTraceEnabled

public static void setWarningTraceEnabled(boolean b)
if b is true, Warning tracing is enabled