com.sap.tc.logging.interfaces

Interface ILog

All Superinterfaces:
Cloneable, IObjectInfo
All Known Subinterfaces:
IFileLog
All Known Implementing Classes:
ConsoleLog, FileLog, Log, StreamLog

public interface ILog
extends IObjectInfo, Cloneable


Method Summary
 void addFilter(Filter filter)
          Adds another filter that controls writing of messages via this log.
 boolean beLogged(int severity)
          Checks whether a message with the specified severity would be written via this log.
 void close()
          Closes output of this log object.
 void flush()
          Flushes buffered records in this log object.
 int getEffectiveSeverity()
          Gets the current effective severity of this log.
 String getEncoding()
          Gets the canonical name of the character encoding that is used for this log.
 Collection getFilters()
          Gets the filters that control writing of messages via this log.
 String getFooter()
          Sets the footer text of this log.
 Formatter getFormatter()
          Gets the formatter that dictates the format of log records in this log.
 String getHeader()
          Gets the header text of this log.
 int getLogTypeAccessibility()
          Gets the current accessibility type of this log.
 int getNumberOfLogRecordsWritten()
          This method returns the number that indicates how many LogRecords have been written so far.
 boolean isAutoFlush()
          Checks whether this log flushes its output stream after each log message.
 boolean isClosed()
          Check is this log closed.
 boolean isOpened()
          Check is this log opened.
 void open()
          Open output of this log object.
 void removeFilter(Filter filter)
          Removes a filter so that it no longer controls writing of messages via this log.
 void removeFilters()
          Removes all filters associated with this log.
 void setAutoFlush(boolean autoFlush)
          Configures this log to flush the output stream after each log message.
 void setEffectiveSeverity(int severity)
          Sets the effective severity of this log.
 void setEncoding(String enc)
          Sets the named character encoding to be used for this log.
 void setFormatter(Formatter formatter)
          Sets the formatter that dictates the format of log records in this log.
 void setLogTypeAccessibility(int value)
          Sets the effective severity of this log.
 int status()
          Status of this log object.
 
Methods inherited from interface com.sap.tc.logging.interfaces.IObjectInfo
getDescription, getName, getVerInUse
 

Method Detail

getFormatter

Formatter getFormatter()
Gets the formatter that dictates the format of log records in this log.

Returns:
Formatter
See Also:
setFormatter(Formatter)

setFormatter

void setFormatter(Formatter formatter)
Sets the formatter that dictates the format of log records in this log.

See Also:
getFormatter()

setEffectiveSeverity

void setEffectiveSeverity(int severity)
Sets the effective severity of this log.

Parameters:
severity - New effective severity

getEffectiveSeverity

int getEffectiveSeverity()
Gets the current effective severity of this log.

Returns:
Effective severity

getHeader

String getHeader()
Gets the header text of this log.

Returns:
Text which represent header of this log.
See Also:
#setHeader(java.lang.String)

getFooter

String getFooter()
Sets the footer text of this log.

Returns:
Text which represent footer of this log.
See Also:
#setHeader(java.lang.String)

getEncoding

String getEncoding()
Gets the canonical name of the character encoding that is used for this log. If no character encoding is set the default character encoding of the platform is used.

Returns:
Name of character encoding
See Also:
setEncoding(java.lang.String)

setEncoding

void setEncoding(String enc)
Sets the named character encoding to be used for this log. If no character encoding is set the default character encoding is used.

Parameters:
enc - Name of character encoding
See Also:
getEncoding()

getLogTypeAccessibility

int getLogTypeAccessibility()
Gets the current accessibility type of this log.

Returns:
Effective severity

setLogTypeAccessibility

void setLogTypeAccessibility(int value)
Sets the effective severity of this log.

Parameters:
severity - New effective severity

getNumberOfLogRecordsWritten

int getNumberOfLogRecordsWritten()
This method returns the number that indicates how many LogRecords have been written so far. This does not take into account how many LogRecords were there in the file before the current session has started. Therefore, please note that this number deals with the number of LogRecords that have been written in the current session.

Returns:
int Number of LogRecords written so far in the current session.

beLogged

boolean beLogged(int severity)
Checks whether a message with the specified severity would be written via this log. The purpose of this method is to avoid evaluating the arguments of a logging call, which is expensive and would be superfluous if a message is not written because of its insufficient severity. The result returned is necessary but not sufficient for writing log messages, that is if the method returns false the message is not going to be written but not vice versa. To this end, the method checks whether the specified severity is equal to or higher than the effective severity of the log. It does not take into account filters associated with the log.

Parameters:
severity - Severity of message to be written

getFilters

Collection getFilters()
Gets the filters that control writing of messages via this log.

Returns:
Unmodifiable collection of filters associated with this log

addFilter

void addFilter(Filter filter)
Adds another filter that controls writing of messages via this log. The results of all filters for a given message are logically anded to determine whether a message is to be written.

Parameters:
filter - New filter

removeFilter

void removeFilter(Filter filter)
Removes a filter so that it no longer controls writing of messages via this log.

Parameters:
filter - Filter to be removed

removeFilters

void removeFilters()
Removes all filters associated with this log.


flush

void flush()
Flushes buffered records in this log object.


isAutoFlush

boolean isAutoFlush()
Checks whether this log flushes its output stream after each log message. Automatic flushing is switched on in a new log.

Returns:
true if and only if this log flushes its output stream after each log message
See Also:
setAutoFlush(boolean)

setAutoFlush

void setAutoFlush(boolean autoFlush)
Configures this log to flush the output stream after each log message. Automatic flushing is switched on in a new log.

Parameters:
autoFlush -
See Also:
isAutoFlush()

close

void close()
Closes output of this log object.


isClosed

boolean isClosed()
Check is this log closed.


open

void open()
Open output of this log object.


isOpened

boolean isOpened()
Check is this log opened.


status

int status()
Status of this log object.

Access Rights

This class can be accessed from:


SC DC
[sap.com] FRAMEWORK [sap.com] tc/ddic/ddicruntime
[sap.com] ENGINEAPI [sap.com] tc/logging
[sap.com] ENGFACADE [sap.com] tc/bl/logging/api
[sap.com] CORE-TOOLS [sap.com] com.sap.engine.client.lib
[sap.com] BRMS-FACADE [sap.com] tc/brms/facade


Copyright 2010 SAP AG Complete Copyright Notice