1 package org.sonatype.aether.spi.log; 2 3 /******************************************************************************* 4 * Copyright (c) 2010-2011 Sonatype, Inc. 5 * All rights reserved. This program and the accompanying materials 6 * are made available under the terms of the Eclipse Public License v1.0 7 * which accompanies this distribution, and is available at 8 * http://www.eclipse.org/legal/epl-v10.html 9 *******************************************************************************/ 10 11 /** 12 * A simple logger to facilitate emission of diagnostic messages. 13 * 14 * @author Benjamin Bentmann 15 */ 16 public interface Logger 17 { 18 19 /** 20 * Indicates whether debug logging is enabled. 21 * 22 * @return {@code true} if debug logging is enabled, {@code false} otherwise. 23 */ 24 boolean isDebugEnabled(); 25 26 /** 27 * Emits the specified message. 28 * 29 * @param msg The message to log, must not be {@code null}. 30 */ 31 void debug( String msg ); 32 33 /** 34 * Emits the specified message along with a stack trace of the given exception. 35 * 36 * @param msg The message to log, must not be {@code null}. 37 * @param error The exception to log, may be {@code null}. 38 */ 39 void debug( String msg, Throwable error ); 40 41 /** 42 * Indicates whether warn logging is enabled. 43 * 44 * @return {@code true} if warn logging is enabled, {@code false} otherwise. 45 */ 46 boolean isWarnEnabled(); 47 48 /** 49 * Emits the specified message. 50 * 51 * @param msg The message to log, must not be {@code null}. 52 */ 53 void warn( String msg ); 54 55 /** 56 * Emits the specified message along with a stack trace of the given exception. 57 * 58 * @param msg The message to log, must not be {@code null}. 59 * @param error The exception to log, may be {@code null}. 60 */ 61 void warn( String msg, Throwable error ); 62 63 }