lib/log/stack: allow annotating arbitrary stack lines with extra metadata #36

Open
opened 2025-09-30 11:31:53 -07:00 by clo · 2 comments
Owner
error: UNWRAP(null)
/Users/clo/code/sitegen/framework/debug.safe.ts:9:11 at globalThis.UNWRAP
    throw new Error(
/Users/clo/code/sitegen/src/file-viewer/bin/scan3.ts:600:11 at producer
          UNWRAP(input.video),
https://github.com/nodejs/node/blob/v24.8.0/lib/internal/process/task_queues.js#L105 at processTicksAndRejections
    runMicrotasks();
/Users/clo/code/sitegen/src/file-viewer/models/derived.ts:74:13 at run
            await producer(tmp);

it would be nice if i could

+stack.annotate({ mediaFile: mediaFile.path });
 await producer.run({

and get

 error: UNWRAP(null)
 /Users/clo/code/sitegen/framework/debug.safe.ts:9:11 at globalThis.UNWRAP
     throw new Error(
 /Users/clo/code/sitegen/src/file-viewer/bin/scan3.ts:600:11 at producer
          UNWRAP(input.video),
 https://github.com/nodejs/node/blob/v24.8.0/lib/internal/process/task_queues.js#L105 at processTicksAndRejections
     runMicrotasks();
 /Users/clo/code/sitegen/src/file-viewer/models/derived.ts:74:13 at run
+  mediaFile: /2024/freeze tag.mp4 
             await producer(tmp);
           
``` error: UNWRAP(null) /Users/clo/code/sitegen/framework/debug.safe.ts:9:11 at globalThis.UNWRAP throw new Error( /Users/clo/code/sitegen/src/file-viewer/bin/scan3.ts:600:11 at producer UNWRAP(input.video), https://github.com/nodejs/node/blob/v24.8.0/lib/internal/process/task_queues.js#L105 at processTicksAndRejections runMicrotasks(); /Users/clo/code/sitegen/src/file-viewer/models/derived.ts:74:13 at run await producer(tmp); ``` it would be nice if i could ```diff +stack.annotate({ mediaFile: mediaFile.path }); await producer.run({ ``` and get ```diff error: UNWRAP(null) /Users/clo/code/sitegen/framework/debug.safe.ts:9:11 at globalThis.UNWRAP throw new Error( /Users/clo/code/sitegen/src/file-viewer/bin/scan3.ts:600:11 at producer UNWRAP(input.video), https://github.com/nodejs/node/blob/v24.8.0/lib/internal/process/task_queues.js#L105 at processTicksAndRejections runMicrotasks(); /Users/clo/code/sitegen/src/file-viewer/models/derived.ts:74:13 at run + mediaFile: /2024/freeze tag.mp4 await producer(tmp); ```
Author
Owner

could do this with node:async_hooks

could do this with node:async_hooks
Author
Owner

another case is inserting arbitrary stack lines, such as to highlight JSX components.

another case is inserting arbitrary stack lines, such as to highlight JSX components.
Sign in to join this conversation.
No labels
bug
chore
feat
lib
site
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: clo/sitegen#36
No description provided.