Class Logger
java.lang.Object
org.daiitech.naftah.playground.utils.logging.Logger
Simple logger implementation used by the Naftah Playground.
This logger provides basic level-based logging and forwards log
messages to the browser-hosted logging console through the
NaftahPlayground bridge.
Messages are emitted only when the configured logger level permits the requested message level. Log output follows the format:
[LEVEL] LoggerName - Message
This class is intended for lightweight runtime diagnostics within browser-hosted environments and is not designed as a replacement for full-featured logging frameworks.
- Author:
- Chakib Daii
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidLogs a debug message.voidLogs an error message.voidLogs an informational message.private voidLogs a message at the specified level.voidUpdates the logger's active logging level.voidLogs a trace message.voidLogs a warning message.
-
Field Details
-
name
Name of the logger, included in every log message. -
level
Current logging level.
-
-
Constructor Details
-
Logger
Creates a logger with the specified name and logging level.- Parameters:
name- the logger namelevel- the minimum logging level to allow
-
-
Method Details
-
setLevel
Updates the logger's active logging level.- Parameters:
level- the new logging level
-
error
Logs an error message.- Parameters:
msg- the message to log
-
warn
Logs a warning message.- Parameters:
msg- the message to log
-
info
Logs an informational message.- Parameters:
msg- the message to log
-
debug
Logs a debug message.- Parameters:
msg- the message to log
-
trace
Logs a trace message.- Parameters:
msg- the message to log
-
log
Logs a message at the specified level.If the current logger configuration allows the supplied level, the message is forwarded to the browser logging bridge. Any errors occurring during log delivery are silently ignored to prevent logging failures from affecting application execution.
- Parameters:
msgLevel- the level of the message being loggedmsg- the message text
-