com.sap.tc.logging
Class StreamLog

java.lang.Object
  |
  +--com.sap.tc.logging.ExceptionHandling
        |
        +--com.sap.tc.logging.Log
              |
              +--com.sap.tc.logging.StreamLog
All Implemented Interfaces:
java.lang.Cloneable, ILog, IObjectInfo
Direct Known Subclasses:
ConsoleLog, FileLog

public class StreamLog
extends Log

Writes log records to output streams.


Fields inherited from class com.sap.tc.logging.Log
LOG_ACCESSABILITY_TYPE_LOCAL_LOG, LOG_ACCESSABILITY_TYPE_NORMAL_LOG, LOG_ACCESSABILITY_TYPE_PRIVATE_LOG, STATUS_CLOSED, STATUS_INVALID, STATUS_OPENED
 
Constructor Summary
StreamLog(java.io.OutputStream stream)
          Configures this stream log for writing to an output stream.
StreamLog(java.io.OutputStream stream, Formatter formatter)
          Same as StreamLog(java.io.OutputStream) but configures for writing with a custom formatter.
StreamLog(java.io.OutputStream stream, java.lang.String enc)
          Configures this stream log for writing to an output stream with a custom character encoding.
StreamLog(java.io.OutputStream stream, java.lang.String enc, Formatter formatter)
          Same as StreamLog(java.io.OutputStream, java.lang.String) but configures for writing with a custom formatter and character encoding.
 
Method Summary
 java.lang.String getEncoding()
          Gets the canonical name of the character encoding that is used for this log.
 void setEncoding(java.lang.String enc)
          Sets the named character encoding to be used for this log.
 
Methods inherited from class com.sap.tc.logging.Log
addFilter, beGroup, beLogged, close, flush, getDescription, getEffectiveSeverity, getFilters, getFooter, getFormatter, getHeader, getLoggedCount, getLogName, getLogTypeAccessibility, getName, getNumberOfLogRecordsWritten, getOwners, getRecord, getVerInUse, isAutoFlush, isClosed, isFiltersAgreeing, isOpened, isSuppressing, open, removeFilter, removeFilters, reset, resetLoggedCount, setAutoFlush, setDescription, setEffectiveSeverity, setFormatter, setLogName, setLogTypeAccessibility, setName, setSuppressing, size, status, write
 
Methods inherited from class com.sap.tc.logging.ExceptionHandling
getException, getExceptions, handleException, handleException, resetException, throwException
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StreamLog

public StreamLog(java.io.OutputStream stream)
Configures this stream log for writing to an output stream.
Parameters:
stream - Output stream
See Also:
StreamLog(java.io.OutputStream, java.lang.String)

StreamLog

public StreamLog(java.io.OutputStream stream,
                 Formatter formatter)
Same as StreamLog(java.io.OutputStream) but configures for writing with a custom formatter.
Parameters:
stream - Output stream
formatter - Formatter
See Also:
StreamLog(java.io.OutputStream, java.lang.String, Formatter)

StreamLog

public StreamLog(java.io.OutputStream stream,
                 java.lang.String enc)
          throws java.io.UnsupportedEncodingException
Configures this stream log for writing to an output stream with a custom character encoding.
Parameters:
stream - Output stream
enc - Name of character encoding
See Also:
StreamLog(java.io.OutputStream)

StreamLog

public StreamLog(java.io.OutputStream stream,
                 java.lang.String enc,
                 Formatter formatter)
          throws java.io.UnsupportedEncodingException
Same as StreamLog(java.io.OutputStream, java.lang.String) but configures for writing with a custom formatter and character encoding.
Parameters:
stream - Output stream
enc - Name of character encoding
formatter - Formatter
Throws:
java.io.UnsupportedEncodingException - Character encoding not supported
See Also:
StreamLog(java.io.OutputStream, Formatter)
Method Detail

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.
Overrides:
getEncoding in class Log
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. Note: To use new encoding value, the Log must be first closed using the #Log.close() method, then opened with #Log.open() method.
Overrides:
setEncoding in class Log
Parameters:
enc - Name of character encoding
See Also:
getEncoding()