|
Oracle Fusion Middleware Java API Reference for Oracle ADF Data Visualization Components 11g Release 1 (11.1.1.1.0) E12063-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectoracle.dss.util.xdo.common.log.Logger
public class Logger
This class is a central logging facility for xDocPro.
// Log a message Logger.log("Copying string from buffer xyz to buffer zyx.", Logger.STATEMENT); // Log a message with the current object Logger.log(this, "Copying string from buffer xyz to buffer zyx.", Logger.STATEMENT); // Log an exception Logger.log(exception); // Log an exception with level. Logger.log(exception, Logger.EXCEPTION); // Log an exception with level and the current object Logger.log(this, exception, Logger.EXCEPTION);
// Set the system logging level to EXCEPTION Logger.setLevel(Logger.EXCEPTION); // This log message will not be logged because the message // logging level is lower than EXCEPTION Logger.log(this, "Copying string from buffer xyz to buffer zyx.", Logger.STATEMENT); // This log message will be logged because the message // logging level is the same or higher than EXCEPTION Logger.log(this, "Copying string from buffer xyz to buffer zyx.", Logger.EXCEPTION);
XDOLog
Field Summary |
---|
Fields inherited from interface oracle.dss.util.xdo.common.log.XDOLogConstants |
---|
ERROR, EVENT, EXCEPTION, OFF, PROCEDURE, RCS_ID, STATEMENT, UNEXPECTED |
Method Summary | |
---|---|
static XDOLog |
getLog()
Returns the Log instance that is used in this class. |
static java.lang.String |
getLogDir()
Returns the |
static java.lang.String |
getTimeStampStr()
Get the current time stamp Example return value: "012104_020341453" means 1/21/2004 02:03:41.453 |
static boolean |
hasExceptions()
|
static void |
init()
This method will check the xdodebug.cfg file under the |
static boolean |
isDebugMode()
Returns true if it's in the debug mode |
static boolean |
isEnabled(int pLevel)
Checks whether logging is enabled for this level. |
static void |
log(java.lang.Object pObj,
java.lang.String pMsg,
int pLevel)
Writes the given string to the log, passing in the object doing the calling. |
static void |
log(java.lang.Object pObj,
java.lang.Throwable pError)
Writes the stack trace of given Throwable to the log with the EXCEPTION message logging level. |
static void |
log(java.lang.Object pObj,
java.lang.Throwable pError,
int pLevel)
Writes the stack trace of given Throwable to the log, passing in the object doing the calling. |
static void |
log(java.lang.String pMsg)
Deprecated. |
static void |
log(java.lang.String pMsg,
int pLevel)
Writes the given string to the log, passing in the object doing the calling. |
static void |
log(java.lang.Throwable pError)
Writes the stack trace of given Throwable to the log with the EXCEPTION message logging level. |
static void |
log(java.lang.Throwable pError,
int pLevel)
Writes the stack trace of given Throwable to the log. |
static java.io.InputStream |
logFile(java.io.InputStream in,
java.lang.String filename)
Logs a file under the |
static java.io.Reader |
logFile(java.io.Reader in,
java.lang.String filename)
Logs a file under the |
static void |
main(java.lang.String[] args)
|
static void |
setLevel(int pLevel)
Sets the system logging level. |
static void |
setLog(XDOLog pLog)
Sets the Log instance that you want to use in this class. |
static void |
setModule(java.lang.String pModule)
Sets the class/package for which logging should be turned on. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static void setLog(XDOLog pLog)
pLog
- XDOLog instance.public static XDOLog getLog()
public static void setLevel(int pLevel)
// Set the system logging level to EXCEPTION Logger.setLevel(Logger.EXCEPTION); // This log message will not be logged because the message // logging level is lower than EXCEPTION Logger.log(this, "Copying string from buffer xyz to buffer zyx.", Logger.STATEMENT); // This log message will be logged because the message // logging level is the same or higher than EXCEPTION Logger.log(this, "Copying string from buffer xyz to buffer zyx.", Logger.EXCEPTION);
pLevel
- System logging levelpublic static void setModule(java.lang.String pModule)
pModule
- Module name to be loggedpublic static void log(java.lang.Object pObj, java.lang.String pMsg, int pLevel)
pObj
- the "this" pointer sent by the caller to determine
which class is writing the log messagepString
- the hard-coded string to write to the logpLevel
- the level of the messagepublic static void log(java.lang.String pMsg)
public static void log(java.lang.String pMsg, int pLevel)
pString
- the hard-coded string to write to the logpLevel
- the level of the messagepublic static void log(java.lang.Object pObj, java.lang.Throwable pError, int pLevel)
pObj
- the "this" pointer sent by the caller to determine
which class is writing the log messagepError
- java Error or ExceptionpLevel
- the level of the messagepublic static void log(java.lang.Throwable pError, int pLevel)
pError
- java Error or ExceptionpLevel
- the level of the messagepublic static void log(java.lang.Object pObj, java.lang.Throwable pError)
pLevel
- the level of the messagepublic static void log(java.lang.Throwable pError)
pObj
- the "this" pointer sent by the caller to determine
which class is writing the log messagepLevel
- the level of the messagepublic static boolean isEnabled(int pLevel)
pLevel
- the level of the message
true
if logging is enabled for pLevel
false
if logging is not.public static boolean hasExceptions()
public static java.lang.String getTimeStampStr()
public static void init()
public static boolean isDebugMode()
public static java.lang.String getLogDir()
public static java.io.InputStream logFile(java.io.InputStream in, java.lang.String filename)
You must close the returned InputStream like:
in2 = logFile( in, filename );
...
// process ...
...
if( in2 != in )
{
in2.close();
}
in
- InputStream to be loggedfilename
- filename for the log file
public static java.io.Reader logFile(java.io.Reader in, java.lang.String filename)
You must close the returned Reader like:
in2 = logFile( in, filename );
...
// process ...
...
if( in2 != in )
{
in2.close();
}
in
- Reader to be loggedfilename
- filename for the log file
public static void main(java.lang.String[] args)
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Data Visualization Components 11g Release 1 (11.1.1.1.0) E12063-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |