Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumNodeJSasync_hooks for contextSingle-choice MCQ

When wiring up custom context tracking with async_hooks, why is using console.log inside the hook callbacks dangerous?

const hook = async_hooks.createHook({ init(asyncId, type, triggerAsyncId) { console.log('init', type); // problematic } }); hook.enable();