Class LogManager
java.lang.Object
org.daiitech.naftah.playground.utils.logging.LogManager
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 Summary
FieldsModifier and TypeFieldDescriptionprivate static LogLevelGlobal logging level used for newly created loggers. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
GLOBAL_LEVEL
Global logging level used for newly created loggers.Defaults to
LogLevel.INFO.
-
-
Constructor Details
-
LogManager
private LogManager()Private constructor to prevent instantiation. ThrowsNaftahBugErrorif called.
-
-
Method Details
-
setLevel
Updates the global logging level.The supplied value is parsed using
LogLevel.fromString(String). Invalid ornullvalues result in the default level (LogLevel.INFO) being used.- Parameters:
level- the logging level name
-
getLogger
Creates a new logger with the current global logging level.- Parameters:
name- the logger name- Returns:
- a new logger instance
-