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

com.github.croesch.logging.Log Maven / Gradle / Ivy

There is a newer version: 1.3
Show newest version
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