Function createCallbackProvider

  • Create and return an IDbgProvider which will call the provided callback function when the level is less than the maximum defined. Which defaults to DbgLevel.Error, so all Critical, Terminal and Error.

    Example

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

    // Add the debugger provider to the default $Dbg instance, this will
    // cause any message which is received up to the maximum error level
    // to call the callback function.
    $Dbg.addProvider(createCallbackProvider({
    cb: (log: IDbgMemoryLog) => {
    }
    }));

    // throws an exception with "Error Message"
    $dbgError("Error Message");

    Parameters

    Returns IDbgProvider

    A new IDbgProvider instance

Generated using TypeDoc