Home > @magiclane/maps-sdk > Logger
Logger class
Configurable logger for the Magic Lane Maps SDK.
Provides centralized logging with configurable levels, custom handlers, and optional timestamps. By default, only error messages are logged.
Signature:
declare class SdkLogger Example
// Enable debug logging
Logger.configure({ level: 'debug' });
// Use custom handler (e.g., for external logging service)
Logger.configure({
level: 'info',
handler: (level, msg, ...args) => myLogger.log(level, msg, ...args)
});
// Add timestamps
Logger.configure({ level: 'debug', timestamp: true });
// Disable all logging
Logger.configure({ level: 'none' });
// Reset to defaults
Logger.reset();Core
Methods
|
Method |
Modifiers |
Description |
|---|---|---|
|
|
Configure the logger settings. Settings are merged with existing configuration. | |
|
|
Log a debug message. Debug messages are for development and troubleshooting. | |
|
|
Log an error message. Errors indicate serious problems that require attention. | |
|
|
Get a copy of the current configuration. | |
|
|
Log an informational message. Info messages provide useful runtime information. | |
|
|
Reset logger to default configuration. Useful for testing or resetting after temporary changes. | |
|
|
Log a warning message. Warnings indicate potential problems that don't prevent operation. |