Class LogTools

java.lang.Object
qupath.lib.common.LogTools

public class LogTools extends Object
Helper class for logging.
Since:
v0.4.0
Author:
Pete Bankhead
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    logOnce(org.slf4j.Logger logger, String message)
    Log a message once at the INFO level.
    static boolean
    logOnce(org.slf4j.Logger logger, org.slf4j.event.Level level, String message)
    Log a message once at the specified level.
    static boolean
    warnOnce(org.slf4j.Logger logger, String message)
    Log a message once at the WARN level.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LogTools

      public LogTools()
  • Method Details

    • logOnce

      public static boolean logOnce(org.slf4j.Logger logger, org.slf4j.event.Level level, String message)
      Log a message once at the specified level.

      This is intended primarily to give a way to warn the user if methods are deprecated, but avoid emitting large numbers of identical messages if the method is called many times.

      Parameters:
      logger -
      level -
      message -
      Returns:
      true if the message was logged, false otherwise (i.e. it has already been logged)
    • logOnce

      public static boolean logOnce(org.slf4j.Logger logger, String message)
      Log a message once at the INFO level.

      This is intended primarily to give a way to notify the user if methods are deprecated, but avoid emitting large numbers of identical messages if the method is called many times.

      Parameters:
      logger -
      message -
      Returns:
      true if the message was logged, false otherwise (i.e. it has already been logged)
    • warnOnce

      public static boolean warnOnce(org.slf4j.Logger logger, String message)
      Log a message once at the WARN level.

      This is intended primarily to give a way to warn the user if methods are deprecated, but avoid emitting large numbers of identical messages if the method is called many times.

      Parameters:
      logger -
      message -
      Returns:
      true if the message was logged, false otherwise (i.e. it has already been logged)