@nevware21/ts-debug-providers
    Preparing search index...

    Interface IDbgMemoryProvider

    Defines the configuration options for the console debug provider.

    import { $Dbg } from "@nevware21/ts-debug";
    import { createMemoryProvider } from "@nevware21/ts-debug-provider";

    // Set the config to enable debug messages to be displayed
    // to the console
    let dbgConfig = {
    lvl: DblLevel.Debug
    };

    let provider = createMemoryProvider(dbgConfig);
    $Dbg.addProvider(provider);
    interface IDbgMemoryProvider {
        _dbgCbAdd?: (dbg: IDbg) => void;
        _dbgCbRm?: (dbg: IDbg) => void;
        chkLvl?: (theLevel: number) => boolean;
        getLogs: () => IDbgMemoryLog[];
        log: (ctx: IDbgLogCtx, message: string, data?: any) => void;
    }

    Hierarchy

    • IDbgProvider
      • IDbgMemoryProvider
    Index

    Properties

    _dbgCbAdd?: (dbg: IDbg) => void

    Optional function called when the provider is added to an IDbg instance

    Type Declaration

      • (dbg: IDbg): void
      • Parameters

        • dbg: IDbg

          The dbg instance

        Returns void

    _dbgCbRm?: (dbg: IDbg) => void

    Optional function called when the provider is removed from a IDbg instance

    Type Declaration

      • (dbg: IDbg): void
      • Parameters

        • dbg: IDbg

          The dbg instance

        Returns void

    chkLvl?: (theLevel: number) => boolean

    Checks and returns whether any logging will be performed at the specified level by this provider instance.

    Type Declaration

      • (theLevel: number): boolean
      • Parameters

        • theLevel: number

          The level to check

        Returns boolean

        true if at least one log entry would be recorded otherwise false

    getLogs: () => IDbgMemoryLog[]

    Return the logs held in memory

    Type Declaration

    log: (ctx: IDbgLogCtx, message: string, data?: any) => void

    Log a message at the provided Debug Level to the debug provider with an optional data details to be associated with the message.

    Type Declaration

      • (ctx: IDbgLogCtx, message: string, data?: any): void
      • Parameters

        • ctx: IDbgLogCtx

          The context for the log message

        • message: string

          The message to display to the log

        • Optionaldata: any

          An optional data element to be associated with the message.

        Returns void