Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1)

E12063-03


oracle.dss.util.xdo.common.log
Class XDOLogImpl

java.lang.Object
  extended by oracle.dss.util.xdo.common.log.XDOLogImpl

All Implemented Interfaces:
XDOLog, XDOLogConstants

public class XDOLogImpl
extends java.lang.Object
implements XDOLog

The class XDOLogImpl is an implementation of XDOLog for a standalone environment. It has no dependency with OA except VersionInfo.

See Also:
Logger

Field Summary

 

Fields inherited from interface oracle.dss.util.xdo.common.log.XDOLog
RCS_ID

 

Fields inherited from interface oracle.dss.util.xdo.common.log.XDOLogConstants
ERROR, EVENT, EXCEPTION, OFF, PROCEDURE, STATEMENT, UNEXPECTED

 

Constructor Summary
XDOLogImpl()
          Default constructor.

 

Method Summary
 boolean isEnabled(int pLevel)
          Checks whether logging is enabled for this level.
 void setDestination(java.io.OutputStream pOut)
          Sets the logging destination.
 void setDestination(java.io.Writer pOut)
          Sets the logging destination.
 void setLevel(int pLevel)
          Set the logging level.
 void setModule(java.lang.String pModule)
          Sets the class/package for which logging should be turned on.
 void write(java.lang.Object pThis, java.lang.String pString, int pLevel)
          Write a log.
static void write(java.lang.Object pThis, java.lang.String pString, int pLevel, java.io.PrintWriter out)
          Write a log to out.
 void write(java.lang.String pString, int pLevel)
          Write a log.

 

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

 

Constructor Detail

XDOLogImpl

public XDOLogImpl()
Default constructor. Logs will be written to System.out by default. You can change the log destination by calling setDestination() methods.
Parameters:
pOut - Logging destination
See Also:
setDestination(Writer), setDestination(OutputStream)

Method Detail

setDestination

public void setDestination(java.io.Writer pOut)
Sets the logging destination.
Parameters:
pOut - Logging destination

setDestination

public void setDestination(java.io.OutputStream pOut)
Sets the logging destination.
Parameters:
pOut - Logging destination

setLevel

public void setLevel(int pLevel)
Set the logging level. It can use one of the 7 values: The levels are listed in descending order of severity. Only log messages which have a level greater than or equal to the set value will be displayed.

When you set the value to 'OFF', no log info will be displayed.

Specified by:
setLevel in interface XDOLog
Parameters:
pLevel - System logging level

setModule

public void setModule(java.lang.String pModule)
Sets the class/package for which logging should be turned on. Only log messages which belong to the same module will be displayed. In its internal, it does the forward matching with the absolute class name of the object passed by write() method. For example, if you pass "java.io" to this method, the log mesasges occurred in "java.io.InputStream" or "java.io.Writer" will be logged. If you pass If you pass "all", it will log everything. The default is "all".
Specified by:
setModule in interface XDOLog
Parameters:
pModule - Module name to be logged

write

public static void write(java.lang.Object pThis,
                         java.lang.String pString,
                         int pLevel,
                         java.io.PrintWriter out)
Write a log to out.

Logging message will be like;

 [component][logging level] log message text
 [component][logging level] log message text
 [component][logging level] log message text
 [component][logging level] log message text
 [component][logging level] log message text
 
Usually you can pass "this" for the first parameter to log in order to specify the current object in the log.
Parameters:
pThis - Current object
pString - Log message
pLevel - Logging level
out - output Writer

write

public void write(java.lang.Object pThis,
                  java.lang.String pString,
                  int pLevel)
Write a log.

Logging message will be like;

 [component][logging level] log message text
 [component][logging level] log message text
 [component][logging level] log message text
 [component][logging level] log message text
 [component][logging level] log message text
 
Usually you can pass "this" for the first parameter to log in order to specify the current object in the log.
Specified by:
write in interface XDOLog
Parameters:
pThis - Current object
pString - Log message
pLevel - Logging level

write

public void write(java.lang.String pString,
                  int pLevel)
Write a log. This message will be logged regardless of the module setting by setModule() method.
Specified by:
write in interface XDOLog
Parameters:
pString - Log message
pLevel - Logging level
See Also:
write(Object, String, int), setModule(String)

isEnabled

public boolean isEnabled(int pLevel)
Checks whether logging is enabled for this level. For performance reasons, User must check this before constructing any new Objects for logging.
Specified by:
isEnabled in interface XDOLog
Parameters:
pLevel - the level of the message
Returns:
true if logging is enabled for pLevel false if logging is not.

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Data Visualization Components
11g Release 1 (11.1.1)

E12063-03


Copyright © 1997, 2009, Oracle. All rights reserved.