-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Rationale
In our VSCode extension we use simple console.log() and console.error() functions to print debugging-related stuff. It does help a lot, but it has quite a few big flaws.
- Users' dev console gets littered with our log messages
- Other extensions
console.log()go to the same shared console that also doesn't help - Console logs are not permanent, they are destroyed upon VSCode reload
- It is quite a process for users to open the console and obtain the appropriate payload we need
- Nested objects in console are collapsed, and we need to ask users to do work and expand them for our needs.
Proposal
At the end of they day we need to record logs in files (put them in ExtensionHost.logPath)
The initial proposal for the infrastructure was stated by @matklad in this comment.
We currently haven't agreed on the exact design of logging. So this is need to be done yet.
Just a quick-and-not-yet-ultimate thought from me: I'd like to propose some logger package like
pino.
If anybody has some design proposal, it would be great to hear from you! Anyway, once I have time, I'll take it to investigate what we can do here and post my thoughts here so we can agree on the final shape of our logging infra.