-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic debug logging #5541
Basic debug logging #5541
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (I saw the comment about the issue with tsx)
I love the idea of the decorator!
One suggestion: what about a class level decorator that will automatically log for all the methods of the class? So you only have to add it at the beginning instead of every method
I've been testing this, and I think this is too verbose to be useful. I believe the decorator approach will lead to printing too much data, so I think it's better to remove it and manually log what we find useful. For example, I think logging these things is useful, but they could be much more succinct:
|
try { | ||
const usedCliArguments: boolean[] = new Array(cliArguments.length).fill( | ||
false, | ||
); | ||
|
||
log("Parsing builtin global options"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think printing just the results would probably be enough in most cases, and make the output less verbose/more helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean in general. I noticed a pattern of "doing this", "this is its result", which I do a ton for manual debugging, but can be too verbose.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just left a few comments
withDebugLogs
decorator to core to easily enable debug logging to any class methodfixes #5363
I would add a screenshot of the output, but there's A Lot. Recommend pulling the branch and testing inside
v-next/example-project