enable logs; add sentry logging to block runs (debugger) (#3205)

This commit is contained in:
Jonathan Dobson
2025-08-15 11:25:53 -04:00
committed by GitHub
parent e09bf89f19
commit fc55729257
5 changed files with 111 additions and 18 deletions

View File

@@ -0,0 +1,26 @@
import { createContext } from "react";
type LogFn = (message: string, data?: Record<string, unknown>) => void;
interface Logging {
info: LogFn;
warn: LogFn;
error: LogFn;
}
// make this a stub of LogFn that does nothing
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const noop: LogFn = (..._: Parameters<LogFn>) => {};
const stub: Logging = {
info: noop,
warn: noop,
error: noop,
};
type GetLogging = () => Logging;
const LoggingContext = createContext<GetLogging>(() => stub);
export { LoggingContext, stub as loggingStub };