Package com.google.api.client.util
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 java.io.FilterOutputStream
out
-
Constructor Summary
ConstructorsConstructorDescriptionLoggingOutputStream
(OutputStream outputStream, Logger logger, Level loggingLevel, int contentLoggingLimit) -
Method Summary
Methods inherited from class java.io.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 be0
to avoid logging content)
-
-
Method Details
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
write
- Overrides:
write
in classFilterOutputStream
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classFilterOutputStream
- Throws:
IOException
-
getLogStream
Returns the log stream.
-