MCPcopy Create free account
hub / github.com/antlr/codebuff / LoggingSuppressor

Class LoggingSuppressor

corpus/java/training/guava/io/Closer.java:250–261  ·  view source on GitHub ↗

Suppresses exceptions by logging them.

Source from the content-addressed store, hash-verified

248 * Suppresses exceptions by logging them.
249 */
250 @VisibleForTesting
251 static final class LoggingSuppressor implements Suppressor {
252
253 static final LoggingSuppressor INSTANCE = new LoggingSuppressor();
254
255 @Override
256 public void suppress(Closeable closeable, Throwable thrown, Throwable suppressed) {
257 // log to the same place as Closeables
258 Closeables.logger.log(
259 Level.WARNING, "Suppressing exception thrown when closing " + closeable, suppressed);
260 }
261 }
262
263 /**
264 * Suppresses exceptions by adding them to the exception that will be thrown using JDK7's

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected