Class LoggingOutputStream
java.lang.Object
java.io.OutputStream
java.io.FilterOutputStream
com.google.api.client.util.LoggingOutputStream
- All Implemented Interfaces:
Closeable, Flushable, AutoCloseable
Thread-safe output stream wrapper that forwards all writes to a given output stream, while
logging all writes to a
LoggingByteArrayOutputStream.- Since:
- 1.9
-
Field Summary
FieldsFields inherited from class FilterOutputStream
out -
Constructor Summary
ConstructorsConstructorDescriptionLoggingOutputStream(OutputStream outputStream, Logger logger, Level loggingLevel, int contentLoggingLimit) -
Method Summary
Methods inherited from class FilterOutputStream
flush, write
-
Field Details
-
logStream
Log stream.
-
-
Constructor Details
-
LoggingOutputStream
public LoggingOutputStream(OutputStream outputStream, Logger logger, Level loggingLevel, int contentLoggingLimit) - Parameters:
outputStream- output stream to forward all writes tologger- loggerloggingLevel- logging levelcontentLoggingLimit- maximum number of bytes to log (may be0to avoid logging content)
-
-
Method Details
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
write
- Overrides:
writein classFilterOutputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterOutputStream- Throws:
IOException
-
getLogStream
Returns the log stream.
-