Suppresses exceptions by logging them.
| 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 |
nothing calls this directly
no outgoing calls
no test coverage detected