-
Notifications
You must be signed in to change notification settings - Fork 560
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
Adds logging and ability to download logs #2194
Conversation
if (!options || typeof options !== 'object') options = {}; | ||
|
||
const formatMessageWithMeta = (info) => { | ||
const args = info[Symbol.for('splat')]; |
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.
what's the reason for a Symbol
here and what's the reason for splat
?
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.
It's been a while so my recollection is a little fuzzy - wish I added a comment when I initially wrote this. 😅 Per the Winston docs, Symbol.for('splat')
is how splat arguments are extracted. I believe this piece of logic handles the case where splat arguments could be populated with an array like [undefined]
or some such, leading to some funky output.
I think this is moot if splatting is entirely not used (e.g. log.info("message: %s", x)
), although you may encounter it even with log.info("message: ", x)
, but not 100 percent sure - I may have been working around some default behavior. You may need to verify output with/without this piece of logic.
Fix
Stole liberally from https://github.com/Automattic/wp-desktop/pull/814/files.
This PR adds logging to the app. It also adds a menu item to download those logs. This will be helpful in diagnosing issues.
Test
Release
Adds logging and ability to download logs