All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.apache.maven.shared.invoker.InvokerLogger Maven / Gradle / Ivy

package org.apache.maven.shared.invoker;

/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

/**
 * A logger used by {@link org.apache.maven.shared.invoker.Invoker} instances to output diagnostic messages.
 *
 * @see Invoker#setLogger(InvokerLogger)
 * @author Jason van Zyl
 */
public interface InvokerLogger
{

    /**
     * The threshold for debug output.
     */
    int DEBUG = 4;

    /**
     * The threshold for info output.
     */
    int INFO = 3;

    /**
     * The threshold for warn output.
     */
    int WARN = 2;

    /**
     * The threshold for error output.
     */
    int ERROR = 1;

    /**
     * The threshold for fatal error output.
     */
    int FATAL = 0;

    /**
     * Logs the specified debug message.
     *
     * @param message The message to log, may be null.
     */
    void debug( String message );

    /**
     * Logs the specified debug message and the accompanying exception.
     *
     * @param message The message to log, may be null.
     * @param throwable The exception to log, may be null.
     */
    void debug( String message, Throwable throwable );

    /**
     * Tests whether debug output is enabled for this logger.
     *
     * @return true if messages with priority "debug" or above are logged, false
     *         otherwise.
     */
    boolean isDebugEnabled();

    /**
     * Logs the specified info message.
     *
     * @param message The message to log, may be null.
     */
    void info( String message );

    /**
     * Logs the specified info message and the accompanying exception.
     *
     * @param message The message to log, may be null.
     * @param throwable The exception to log, may be null.
     */
    void info( String message, Throwable throwable );

    /**
     * Tests whether info output is enabled for this logger.
     *
     * @return true if messages with priority "info" or above are logged, false otherwise.
     */
    boolean isInfoEnabled();

    /**
     * Logs the specified warning message.
     *
     * @param message The message to log, may be null.
     */
    void warn( String message );

    /**
     * Logs the specified warning message and the accompanying exception.
     *
     * @param message The message to log, may be null.
     * @param throwable The exception to log, may be null.
     */
    void warn( String message, Throwable throwable );

    /**
     * Tests whether warn output is enabled for this logger.
     *
     * @return true if messages with priority "warn" or above are logged, false otherwise.
     */
    boolean isWarnEnabled();

    /**
     * Logs the specified error message.
     *
     * @param message The message to log, may be null.
     */
    void error( String message );

    /**
     * Logs the specified error message and the accompanying exception.
     *
     * @param message The message to log, may be null.
     * @param throwable The exception to log, may be null.
     */
    void error( String message, Throwable throwable );

    /**
     * Tests whether error output is enabled for this logger.
     *
     * @return true if messages with priority "error" or above are logged, false
     *         otherwise.
     */
    boolean isErrorEnabled();

    /**
     * Logs the specified fatal error message.
     *
     * @param message The message to log, may be null.
     */
    void fatalError( String message );

    /**
     * Logs the specified fatal error message and the accompanying exception.
     *
     * @param message The message to log, may be null.
     * @param throwable The exception to log, may be null.
     */
    void fatalError( String message, Throwable throwable );

    /**
     * Tests whether fatal error output is enabled for this logger.
     *
     * @return true if messages with priority "fatal" or above are logged, false
     *         otherwise.
     */
    boolean isFatalErrorEnabled();

    /**
     * Sets the logger's threshold.
     *
     * @param threshold The logger's threshold, must be one of {@link #DEBUG}, {@link #INFO}, {@link #WARN},
     *            {@link #ERROR} and {@link #FATAL}.
     */
    void setThreshold( int threshold );

    /**
     * Gets the logger's threshold.
     *
     * @return The logger's threshold, one of {@link #DEBUG}, {@link #INFO}, {@link #WARN}, {@link #ERROR} and
     *         {@link #FATAL}.
     */
    int getThreshold();

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy