Open Bug 1828100 Opened 2 years ago Updated 2 years ago

Integrate `console.createInstance` with MOZ_LOG based on `prefix`

Categories

(DevTools :: Console, enhancement)

Desktop
All
enhancement

Tracking

(Not tracked)

People

(Reporter: Gijs, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

console.createInstance gets used by a lot of chrome code to do logging.

(Other chrome code sometimes uses Console.sys.mjs, but note bug 1430810, or Log.sys.mjs, which IMO should be removed or be a thin wrapper around console.createInstance. We probably want a separate bug for this if one does not exist.)

Anyway, it would be neat if MOZ_LOG captured the console.createInstance stuff. It already has a prefix prop that can be used for the "name" of the log module, so in theory, hopefully integration would be reasonably straightforward.

LogModile::Get() allows dynamic creation of log modules; if it doesn't exist it will create it.

Depends on: 1297323
You need to log in before you can comment on or make changes to this bug.