Lime Web Components API Documentation - v6.24.0
    Preparing search index...

    Interface LogHandlerBeta

    Handler for processing log messages

    Implementations can handle logs by writing to different outputs such as console, memory, IndexedDB, or external services.

    class ConsoleHandler implements LogHandler {
    minLevel = LogLevel.Info;

    handle(entry: LogEntry): void {
    const prefix = `[${entry.level.toUpperCase()}] [${entry.scope}]`;
    console.log(`${prefix} ${entry.message}`, entry.data);
    }
    }

    // Change level at runtime
    consoleHandler.minLevel = LogLevel.Debug;
    interface LogHandler {
        minLevel?: LogLevel;
        handle(entry: LogEntry): void | Promise<void>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    Methods

    Properties

    minLevel?: LogLevel

    Minimum log level this handler should receive

    If specified, the factory will only pass log entries with a level equal to or higher than this value. If not specified, all log entries are passed to the handler.

    Level priority (lowest to highest): Debug → Info → Warn → Error

    This can be changed at runtime to dynamically adjust filtering.

    Methods

    • Beta

      Handles a log entry

      Implementations should handle their own errors internally to ensure reliability. However, any uncaught errors thrown by this method will be caught by the factory to prevent one handler from breaking others. Errors will be logged to the console but will not stop other handlers from receiving the log entry.

      Parameters

      Returns void | Promise<void>