io.cucumber.core.logging.Logger Maven / Gradle / Ivy
package io.cucumber.core.logging;
import java.util.function.Supplier;
/**
* Logs messages to {@link java.util.logging.Logger}.
*
* The methods correspond to {@link java.util.logging.Level} in JUL:
*
* - {@code error} maps to {@link java.util.logging.Level#SEVERE}
* - {@code warn} maps to {@link java.util.logging.Level#WARNING}
* - {@code info} maps to {@link java.util.logging.Level#INFO}
* - {@code config} maps to {@link java.util.logging.Level#CONFIG}
* - {@code debug} maps to {@link java.util.logging.Level#FINE}
* - {@code trace} maps to {@link java.util.logging.Level#FINER}
*
*/
public interface Logger {
/**
* Log the {@code message} at error level.
*
* @param message The message to log.
*/
void error(Supplier message);
/**
* Log the {@code message} and {@code throwable} at error level.
*
* @param throwable The throwable to log.
* @param message The message to log.
*/
void error(Throwable throwable, Supplier message);
/**
* Log the {@code message} at warning level.
*
* @param message The message to log.
*/
void warn(Supplier message);
/**
* Log the {@code message} and {@code throwable} at warning level.
*
* @param throwable The throwable to log.
* @param message The message to log.
*/
void warn(Throwable throwable, Supplier message);
/**
* Log the {@code message} at info level.
*
* @param message The message to log.
*/
void info(Supplier message);
/**
* Log the {@code message} and {@code throwable} at info level.
*
* @param throwable The throwable to log.
* @param message The message to log.
*/
void info(Throwable throwable, Supplier message);
/**
* Log the {@code message} at config level.
*
* @param message The message to log.
*/
void config(Supplier message);
/**
* Log the {@code message} and {@code throwable} at config level.
*
* @param throwable The throwable to log.
* @param message The message to log.
*/
void config(Throwable throwable, Supplier message);
/**
* Log the {@code message} at debug level.
*
* @param message The message to log.
*/
void debug(Supplier message);
/**
* Log {@code message} and {@code throwable} at debug level.
*
* @param throwable The throwable to log.
* @param message The message to log.
*/
void debug(Throwable throwable, Supplier message);
/**
* Log the {@code message} at trace level.
*
* @param message The message to log.
*/
void trace(Supplier message);
/**
* Log the {@code message} and {@code throwable} at trace level.
*
* @param throwable The throwable to log.
* @param message The message to log.
*/
void trace(Throwable throwable, Supplier message);
}