com.sap.tc.logging.interfaces
Interface ILog

All Superinterfaces:
java.lang.Cloneable, IObjectInfo
All Known Subinterfaces:
IFileLog, IReadableLog
All Known Implementing Classes:
Log

public interface ILog
extends IObjectInfo, java.lang.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.
 java.lang.String getEncoding()
          Gets the canonical name of the character encoding that is used for this log.
 java.util.Collection getFilters()
          Gets the filters that control writing of messages via this log.
 java.lang.String getFooter()
          Sets the footer text of this log.
 Formatter getFormatter()
          Gets the formatter that dictates the format of log records in this log.
 java.lang.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(java.lang.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

public Formatter getFormatter()
Gets the formatter that dictates the format of log records in this log.
Returns:
Formatter
See Also:
setFormatter(Formatter)

setFormatter

public void setFormatter(Formatter formatter)
Sets the formatter that dictates the format of log records in this log.
Returns:
Formatter
See Also:
getFormatter()

setEffectiveSeverity

public void setEffectiveSeverity(int severity)
Sets the effective severity of this log.
Parameters:
severity - New effective severity

getEffectiveSeverity

public int getEffectiveSeverity()
Gets the current effective severity of this log.
Returns:
Effective severity

getHeader

public java.lang.String getHeader()
Gets the header text of this log.
Returns:
Text which represent header of this log.
See Also:
#setHeader(java.lang.String)

getFooter

public java.lang.String getFooter()
Sets the footer text of this log.
Returns:
Text which represent footer of this log.
See Also:
#setHeader(java.lang.String)

getEncoding

public java.lang.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

public void setEncoding(java.lang.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

public int getLogTypeAccessibility()
Gets the current accessibility type of this log.
Returns:
Effective severity

setLogTypeAccessibility

public void setLogTypeAccessibility(int value)
Sets the effective severity of this log.
Parameters:
severity - New effective severity

getNumberOfLogRecordsWritten

public 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

public 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

public java.util.Collection getFilters()
Gets the filters that control writing of messages via this log.
Returns:
Unmodifiable collection of filters associated with this log

addFilter

public 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

public 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

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

flush

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

isAutoFlush

public 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

public 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

public void close()
Closes output of this log object.

isClosed

public boolean isClosed()
Check is this log closed.

open

public void open()
Open output of this log object.

isOpened

public boolean isOpened()
Check is this log opened.

status

public int status()
Status of this log object.