1 /******************************************************************************* 2 * Copyright (c) 2009, 2021 Mountainminds GmbH & Co. KG and Contributors 3 * This program and the accompanying materials are made available under 4 * the terms of the Eclipse Public License 2.0 which is available at 5 * http://www.eclipse.org/legal/epl-2.0 6 * 7 * SPDX-License-Identifier: EPL-2.0 8 * 9 * Contributors: 10 * Marc R. Hoffmann - initial API and implementation 11 * 12 *******************************************************************************/ 13 package org.jacoco.agent.rt.internal; 14 15 /** 16 * At several places exception might occur that should be reported. For 17 * testability these exceptions are emitted against this interface. 18 */ 19 public interface IExceptionLogger { 20 21 /** 22 * Default implementation which dumps the stack trace to System.err. 23 */ 24 IExceptionLogger SYSTEM_ERR = new IExceptionLogger() { 25 public void logExeption(final Exception ex) { 26 ex.printStackTrace(); 27 } 28 }; 29 30 /** 31 * Logs the given exception. 32 * 33 * @param ex 34 * exception to log 35 */ logExeption(Exception ex)36 void logExeption(Exception ex); 37 38 } 39