
com.github.croesch.logging.Log Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of crhcomponents Show documentation
Show all versions of crhcomponents Show documentation
Provides some useful components for small Java projects.
package com.github.croesch.logging;
/**
* This is the class that is responsible for all logging events of this library. It will pass all messages to the
* current logger.
*
* @author croesch
* @since Date: Jul 6, 2011
*/
public final class Log {
/** the logger that will handle the messages that arrive hear */
private static Logger logger = new QuietLogger();
/**
* Hidden constructor.
*
* @since Date: Jul 6, 2011
*/
private Log() {
// hide utility class constructor
}
/**
* Replaces the current {@link Logger} with the given one if it's not null
.
*
* @since Date: Jul 6, 2011
* @param log the new {@link Logger}.
*/
public static void setLogger(final Logger log) {
if (log != null) {
logger = log;
}
}
/**
* Passes the given message to the current logger to handle it.
*
* @since Date: Jul 6, 2011
* @param t the {@link Throwable} that occured.
*/
public static void error(final Throwable t) {
logger.printThrowable(t);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy