Datalayer VS Code Extension - v0.0.4
    Preparing search index...

    Logger interface for logging operations with context. Provides structured logging with different severity levels.

    interface ILogger {
        debug(message: string, context?: Record<string, unknown>): void;
        error(
            message: string,
            error?: Error,
            context?: Record<string, unknown>,
        ): void;
        info(message: string, context?: Record<string, unknown>): void;
        timeAsync<T>(
            operation: string,
            fn: () => Promise<T>,
            context?: Record<string, unknown>,
        ): Promise<T>;
        trace(message: string, context?: Record<string, unknown>): void;
        warn(message: string, context?: Record<string, unknown>): void;
    }
    Index

    Methods

    • Logs a debug level message with optional context. Use for debugging information.

      Parameters

      • message: string
      • Optionalcontext: Record<string, unknown>

      Returns void

    • Logs an error level message with error object and optional context. Use for error events that might still allow the application to continue.

      Parameters

      • message: string
      • Optionalerror: Error
      • Optionalcontext: Record<string, unknown>

      Returns void

    • Logs an info level message with optional context. Use for general informational messages.

      Parameters

      • message: string
      • Optionalcontext: Record<string, unknown>

      Returns void

    • Times an async operation and logs start, completion, and errors. Automatically calculates duration and logs at appropriate levels.

      Type Parameters

      • T

      Parameters

      • operation: string

        Name of the operation being timed

      • fn: () => Promise<T>

        Async function to execute and time

      • Optionalcontext: Record<string, unknown>

        Optional context information

      Returns Promise<T>

      Promise that resolves with the function result

    • Logs a trace level message with optional context. Use for very detailed debugging information.

      Parameters

      • message: string
      • Optionalcontext: Record<string, unknown>

      Returns void

    • Logs a warning level message with optional context. Use for potentially harmful situations.

      Parameters

      • message: string
      • Optionalcontext: Record<string, unknown>

      Returns void