Logger
Defined in: packages/client/src/lib/utils/logger.ts:13
Logger class for Maelstrom client debugging.
Provides namespaced logging with optional debug output. Warnings and errors are always logged regardless of enabled state.
Example
Section titled “Example”const logger = new Logger(true); // Enable debug logginglogger.info('Processing message'); // Outputs: [Maelstrom] Processing messageConstructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Logger(
enabled?,namespace?):Logger
Defined in: packages/client/src/lib/utils/logger.ts:23
Creates a new Logger instance.
Parameters
Section titled “Parameters”enabled?
Section titled “enabled?”boolean = false
Whether debug/info logs should be output (default: false)
namespace?
Section titled “namespace?”string = 'Maelstrom'
Optional namespace prefix (default: ‘Maelstrom’)
Returns
Section titled “Returns”Logger
Accessors
Section titled “Accessors”isEnabled
Section titled “isEnabled”Get Signature
Section titled “Get Signature”get isEnabled():
boolean
Defined in: packages/client/src/lib/utils/logger.ts:31
Check if logging is enabled.
Returns
Section titled “Returns”boolean
Methods
Section titled “Methods”debug()
Section titled “debug()”debug(
message, …args):void
Defined in: packages/client/src/lib/utils/logger.ts:45
Log debug message (only if enabled).
Parameters
Section titled “Parameters”message
Section titled “message”string
…unknown[]
Returns
Section titled “Returns”void
error()
Section titled “error()”error(
message, …args):void
Defined in: packages/client/src/lib/utils/logger.ts:71
Log error message (always logged regardless of enabled state).
Parameters
Section titled “Parameters”message
Section titled “message”string
…unknown[]
Returns
Section titled “Returns”void
info()
Section titled “info()”info(
message, …args):void
Defined in: packages/client/src/lib/utils/logger.ts:54
Log info message (only if enabled).
Parameters
Section titled “Parameters”message
Section titled “message”string
…unknown[]
Returns
Section titled “Returns”void
setEnabled()
Section titled “setEnabled()”setEnabled(
value):void
Defined in: packages/client/src/lib/utils/logger.ts:38
Enable or disable logging (excluding errors).
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
warn()
Section titled “warn()”warn(
message, …args):void
Defined in: packages/client/src/lib/utils/logger.ts:63
Log warning message (always logged regardless of enabled state).
Parameters
Section titled “Parameters”message
Section titled “message”string
…unknown[]
Returns
Section titled “Returns”void