Class LoggingInputStream
java.lang.Object
java.io.InputStream
java.io.FilterInputStream
com.google.api.client.util.LoggingInputStream
- All Implemented Interfaces:
Closeable, AutoCloseable
Thread-safe input stream wrapper that forwards all reads to a given input stream, while logging
all reads to a
LoggingByteArrayOutputStream.- Since:
- 1.9
-
Field Summary
FieldsFields inherited from class FilterInputStream
in -
Constructor Summary
ConstructorsConstructorDescriptionLoggingInputStream(InputStream inputStream, Logger logger, Level loggingLevel, int contentLoggingLimit) -
Method Summary
Methods inherited from class FilterInputStream
available, mark, markSupported, read, reset, skip
-
Field Details
-
logStream
Log stream.
-
-
Constructor Details
-
LoggingInputStream
public LoggingInputStream(InputStream inputStream, Logger logger, Level loggingLevel, int contentLoggingLimit) - Parameters:
inputStream- input stream to forward all reads tologger- loggerloggingLevel- logging levelcontentLoggingLimit- maximum number of bytes to log (may be0to avoid logging content)
-
-
Method Details
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
read
- Overrides:
readin classFilterInputStream- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classFilterInputStream- Throws:
IOException
-
getLogStream
Returns the log stream.
-