Class Logger

java.lang.Object
sc.fiji.snt.util.Logger

public class Logger extends Object
The Logger class provides functionality for logging messages with different levels such as info, debug, and warn.

Relies on external services, such as LogService and PrefService, injected via the provided context.

  • Constructor Summary

    Constructors
    Constructor
    Description
    Logger(Class<?> clazz)
     
    Logger(org.scijava.Context context, String callerIdentifier)
    Constructs a new Logger with the specified context and caller identifier.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Logs a debug message (only if debug mode is enabled).
    void
    info(Object msg)
    Logs an informational message.
    boolean
    Checks if debug mode is enabled.
    void
    setDebug(boolean debug)
    Sets the debug mode state.
    void
    warn(String string)
    Logs a warning message.

    Methods inherited from class java.lang.Object

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

    • Logger

      public Logger(Class<?> clazz)
    • Logger

      public Logger(org.scijava.Context context, String callerIdentifier)
      Constructs a new Logger with the specified context and caller identifier.
      Parameters:
      context - the SciJava context for dependency injection
      callerIdentifier - the identifier for the calling class/component
  • Method Details

    • info

      public void info(Object msg)
      Logs an informational message.
      Parameters:
      msg - the message to log
    • debug

      public void debug(Object msg)
      Logs a debug message (only if debug mode is enabled).
      Parameters:
      msg - the debug message to log
    • warn

      public void warn(String string)
      Logs a warning message.
      Parameters:
      string - the warning message to log
    • isDebug

      public boolean isDebug()
      Checks if debug mode is enabled.
      Returns:
      true if debug mode is enabled, false otherwise
    • setDebug

      public void setDebug(boolean debug)
      Sets the debug mode state.
      Parameters:
      debug - true to enable debug mode, false to disable