I want console logging channels

Submitted by Andreas Linnert

This idea is currently being discussed.

I want a console.channel() API that lets developers create named, isolated logging channels in the browser console.

Today every script in a page shares a single console output stream, which quickly becomes an unmanageable wall of text in large or complex applications. There is no native way to separate the logs produced by, say, a state-management library from those produced by a routing layer or a third-party analytics SDK.

I propose a named-channel API along these lines:

const channel = console.channel('my-feature');
channel.log('Hello from my-feature');
channel.warn('Something looks off');
channel.error('Something went wrong');

Browser DevTools would display a filterable list of all registered channels alongside the standard "All messages" view. Selecting a channel would show only its output, making it trivial to focus on the logs that matter right now.

This would benefit every layer of the web development stack:

The pattern is already proven in other environments: Node.js offers util.debuglog(), and logging frameworks like debug for Node/browsers work around the same limitation with monkey-patching. A first-class browser API would make this capability universally available, consistent, and inspectable in DevTools without any third-party dependency.

Tagged
DevTools JavaScript
Votes
0
What are votes for and how are they tallied?