java.lang.Object
org.daiitech.naftah.playground.utils.logging.LogManager

public final class LogManager extends Object
Factory and configuration holder for playground loggers.

This class maintains the global logging level used when creating new Logger instances. All loggers obtained through this manager are initialized with the current global level.

Changing the global level affects only loggers created after the change. Existing logger instances retain the level that was assigned when they were created unless explicitly updated.

Author:
Chakib Daii
  • Field Details

    • GLOBAL_LEVEL

      private static LogLevel GLOBAL_LEVEL
      Global logging level used for newly created loggers.

      Defaults to LogLevel.INFO.

  • Constructor Details

    • LogManager

      private LogManager()
      Private constructor to prevent instantiation. Throws NaftahBugError if called.
  • Method Details

    • setLevel

      public static void setLevel(String level)
      Updates the global logging level.

      The supplied value is parsed using LogLevel.fromString(String). Invalid or null values result in the default level (LogLevel.INFO) being used.

      Parameters:
      level - the logging level name
    • getLogger

      public static Logger getLogger(String name)
      Creates a new logger with the current global logging level.
      Parameters:
      name - the logger name
      Returns:
      a new logger instance