We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fce5c3c commit 7f2c5e7Copy full SHA for 7f2c5e7
1 file changed
src/analysis/debug.ts
@@ -0,0 +1,18 @@
1
+import type { DebugConfig } from "../types.js";
2
+
3
+export function createDebugLogger(
4
+ routeKey: string,
5
+ debugConfig: DebugConfig,
6
+): (message: string) => void {
7
+ const filter = debugConfig.routeFilter;
8
+ const enabled = debugConfig.enabled || filter !== undefined;
9
+ const shouldLog = filter === undefined || routeKey.includes(filter);
10
11
+ if (!enabled || !shouldLog) {
12
+ return () => {};
13
+ }
14
15
+ return (message: string): void => {
16
+ process.stderr.write(`[extractor:${routeKey}] ${message}\n`);
17
+ };
18
+}
0 commit comments