OracleJavaScript API Reference for Oracle ADF Faces

 

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

oracle.adf.view.js.logging
Class AdfLogger

org.ecmascript.object.Object
   |
   +--oracle.adf.view.js.base.AdfObject
         |
         +--oracle.adf.view.js.logging.AdfLogger

public class AdfLogger
extends AdfObject
Logging utilities, modeled on java.util.logging.AdfLogger; The levels in descending order are: In addition there is a level AdfLogger.OFF that can be used to turn off logging, and a level AdfLogger.ALL that can be used to enable logging of all messages. Note that if you call logMessages, etc OFF will really log the message (not ALL).

setFilter(filterFunction) can be used for finer-grained filtering of the log records to publish. The filter function is called with the log record to log and returns true if the log record should be published.



Field Summary

public static Object
DEFAULT_LEVEL
private Object
_filter
private Object
_level
public static Object
LOGGER
The default logging instance
private Object
_loggerName
private static Object
_LOGGERS
private Object
_logWriter
protected static Object
RegisterLevels


Fields inherited from oracle.adf.view.js.base.AdfObject

constructor, superclass


Fields inherited from org.ecmascript.object.Object

prototype


Constructor Summary

public
AdfLogger(Object loggerName, Object logWriter, Object level)
Logging utilities, modeled on java.util.logging.AdfLogger; The levels in descending order are:


Method Summary

protected Object
AddLogRecord(Object logRecord)
Called by subclasses to add a AdfLogRecord to the AdfLogger
private Object
_calcMsg(Object varArgs)
Calculate the message to use when logging
public Object
getFilter()
Returns the current filter
public Object
getLevel()
Returns the level at which this AdfLogger will log messages
public static AdfLogger
getLogger(String loggerName)
Returns the named logger, if any.
public Object
getLogWriter()
Returns the AdfLogWriter that this AdfLogger instance is publishing to
public String
getName()
Returns the name of this logger
protected Object
Init(Object loggerName, Object logWriter, Object level)
Initializes the AdfLogger instance
protected static Object
InitClass()
Initializes the AdfLogger class
public Object
isLoggable(Object level)
Returns true if messages with the specified level will be logged
public Object
log(Object logRecord)
Convenience method for logging a single AdfLogRecord
public Object
logElapsedTime(Object startTime, Object message, Object level)
Convenience method for logging timing information
public Object
logError(Object error, Object level, Object message)
Convenience method for logging an error
public Object
logErrorAsInfo(Object error, Object message)
Convenience method for logging an error at the AdfLogger.INFO severity.
public Object
logErrorAsSevere(Object error, Object message)
Convenience method for logging an error at the AdfLogger.SEVERE severity.
public Object
logErrorAsWarning(Object error, Object message)
Convenience method for logging an error at the AdfLogger.WARNING severity.
public Object
logMessage(Object level, Object messages)
Convenience method for logging a message
public Object
logRecords(Object logRecords)
Convenience method for logging an array of AdfLogRecords
public AdfLogger
register()
Registers the specified logger, copying over any log messages if possible and closing the logger if a logger with that name already exists
protected static Object
RegisterLevels(Object ourClass, Object levelArr)
Creates the AdfLogger convenience methods and accessors
public Object
setFilter(Object newFilter)
Changes the logging filter to the new filter.
public Object
setLevel(Object level)
Sets the level at which this AdfLogger will log messages
public Object
toDebugString()
Override to ditch "Object" and add in the log name and level


Methods inherited from oracle.adf.view.js.base.AdfObject

adopt, clone, createCallback, createInitializedObject, createSubclass, ensureClassInitialization, equals, getClass, GetLazyArrayProperty, GetLazyMapProperty, getTypeName, toString


Field Detail


DEFAULT_LEVEL

public static Object DEFAULT_LEVEL

_filter

private Object _filter

_level

private Object _level

LOGGER

public static Object LOGGER

The default logging instance

_loggerName

private Object _loggerName

_LOGGERS

private static Object _LOGGERS

_logWriter

private Object _logWriter

RegisterLevels

protected static Object RegisterLevels

Constructor Detail


AdfLogger

public AdfLogger(Object loggerName,
                 Object logWriter,
                 Object level)

Logging utilities, modeled on java.util.logging.AdfLogger; The levels in descending order are:
  • AdfLogger.SEVERE (highest value)
  • AdfLogger.WARNING
  • AdfLogger.INFO
  • AdfLogger.CONFIG
  • AdfLogger.FINE
  • AdfLogger.FINER
  • AdfLogger.FINEST (lowest value)
In addition there is a level AdfLogger.OFF that can be used to turn off logging, and a level AdfLogger.ALL that can be used to enable logging of all messages. Note that if you call logMessages, etc OFF will really log the message (not ALL).

setFilter(filterFunction) can be used for finer-grained filtering of the log records to publish. The filter function is called with the log record to log and returns true if the log record should be published.


Parameters:
loggerName    
logWriter    
level    

Method Detail


AddLogRecord

protected Object AddLogRecord(Object logRecord)

Called by subclasses to add a AdfLogRecord to the AdfLogger

Parameters:
logRecord    
Return:
Object

_calcMsg

private Object _calcMsg(Object varArgs)

Calculate the message to use when logging

Parameters:
varArgs    
Return:
Object

getFilter

public Object getFilter()

Returns the current filter

Return:
Object

getLevel

public Object getLevel()

Returns the level at which this AdfLogger will log messages

Return:
Object

getLogger

public static AdfLogger getLogger(String loggerName)

Returns the named logger, if any.

Parameters:
loggerName  -  The name of the logger to return, or the global logger if no logger name is specified
Return:
AdfLogger - the named logger instance, if any

getLogWriter

public Object getLogWriter()

Returns the AdfLogWriter that this AdfLogger instance is publishing to

Return:
Object

getName

public String getName()

Returns the name of this logger

Return:
String - The name of the Logger

Init

protected Object Init(Object loggerName,
                      Object logWriter,
                      Object level)

Initializes the AdfLogger instance

Parameters:
loggerName    
logWriter    
level    
Return:
Object
Overrides:
AdfObject.Init()

InitClass

protected static Object InitClass()

Initializes the AdfLogger class

Return:
Object

isLoggable

public Object isLoggable(Object level)

Returns true if messages with the specified level will be logged

Parameters:
level    
Return:
Object

log

public Object log(Object logRecord)

Convenience method for logging a single AdfLogRecord

Parameters:
logRecord    
Return:
Object
See also:
logRecords(Object)

logElapsedTime

public Object logElapsedTime(Object startTime,
                             Object message,
                             Object level)

Convenience method for logging timing information

Parameters:
startTime  -  Date object when the current timing started
message    
level    
Return:
Object
See also:
log(Object)

logError

public Object logError(Object error,
                       Object level,
                       Object message)

Convenience method for logging an error

Parameters:
error    
level    
message    
Return:
Object

logErrorAsInfo

public Object logErrorAsInfo(Object error,
                             Object message)

Convenience method for logging an error at the AdfLogger.INFO severity.

Parameters:
error    
message    
Return:
Object
See also:
log(Object)
logError(Object, Object, Object)
logErrorAsSevere(Object, Object)

logErrorAsSevere

public Object logErrorAsSevere(Object error,
                               Object message)

Convenience method for logging an error at the AdfLogger.SEVERE severity.

Parameters:
error    
message    
Return:
Object
See also:
log(Object)
logError(Object, Object, Object)
logErrorAsWarning(Object, Object)

logErrorAsWarning

public Object logErrorAsWarning(Object error,
                                Object message)

Convenience method for logging an error at the AdfLogger.WARNING severity.

Parameters:
error    
message    
Return:
Object
See also:
log(Object)
logError(Object, Object, Object)
logErrorAsSevere(Object, Object)

logMessage

public Object logMessage(Object level,
                         Object messages)

Convenience method for logging a message

Parameters:
level    
messages    
Return:
Object
See also:
log(Object)

logRecords

public Object logRecords(Object logRecords)

Convenience method for logging an array of AdfLogRecords

Parameters:
logRecords    
Return:
Object
See also:
log(Object)

register

public AdfLogger register()

Registers the specified logger, copying over any log messages if possible and closing the logger if a logger with that name already exists

Return:
AdfLogger - The existing registered Logger, if any

RegisterLevels

protected static Object RegisterLevels(Object ourClass,
                                       Object levelArr)

Creates the AdfLogger convenience methods and accessors

Parameters:
ourClass    
levelArr    
Return:
Object

setFilter

public Object setFilter(Object newFilter)

Changes the logging filter to the new filter. The filter is a function that takes a AdfLogRecord object and returns true if the AdfLogRecord should be logged.

Parameters:
newFilter    
Return:
Object

setLevel

public Object setLevel(Object level)

Sets the level at which this AdfLogger will log messages

Parameters:
level    
Return:
Object

toDebugString

public Object toDebugString()

Override to ditch "Object" and add in the log name and level

Return:
Object
Overrides:
AdfObject.toDebugString()

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

 

Generated on 2010.12.10 19:37 UTC
Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.