1 /* 2 * Licensed to the Apache Software Foundation (ASF) under one 3 * or more contributor license agreements. See the NOTICE file 4 * distributed with this work for additional information 5 * regarding copyright ownership. The ASF licenses this file 6 * to you under the Apache License, Version 2.0 (the 7 * "License"); you may not use this file except in compliance 8 * with the License. You may obtain a copy of the License at 9 * 10 * http://www.apache.org/licenses/LICENSE-2.0 11 * 12 * Unless required by applicable law or agreed to in writing, 13 * software distributed under the License is distributed on an 14 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 15 * KIND, either express or implied. See the License for the 16 * specific language governing permissions and limitations 17 * under the License. 18 */ 19 package org.apache.maven.plugin.surefire.log.api; 20 21 /** 22 * Allows providers to write console messages on the running maven process. 23 * <br> 24 * This output is associated with the entire test run and not a specific 25 * test, which means it just goes "straight" to the console "immediately". 26 * <br> 27 * This interface is used in org.apache.maven.plugin.surefire.CommonReflector and reflected 28 * via IsolatedClassLoader which can see classes from JRE only. This interface MUST use 29 * JRE types in method signatures, e.g. {@link String} or {@link Throwable}, etc. 30 */ 31 public interface ConsoleLogger { 32 boolean isDebugEnabled(); 33 34 void debug(String message); 35 36 boolean isInfoEnabled(); 37 38 void info(String message); 39 40 boolean isWarnEnabled(); 41 42 void warning(String message); 43 44 boolean isErrorEnabled(); 45 46 /** 47 * @param message message to log 48 */ 49 void error(String message); 50 51 /** 52 * Simply delegates to {@link #error(String) error( toString( t, message ) )}. 53 * 54 * @param message message to log 55 * @param t exception, message and trace to log 56 */ 57 void error(String message, Throwable t); 58 59 /** 60 * Simply delegates to method {@link #error(String, Throwable) error(null, Throwable)}. 61 * 62 * @param t exception, message and trace to log 63 */ 64 void error(Throwable t); 65 }