-
Notifications
You must be signed in to change notification settings - Fork 83
feat: add a verbose flag
#3934
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
feat: add a verbose flag
#3934
Conversation
| } | ||
|
|
||
| const logPluginMethodStart = function (verbose) { | ||
| logVerbose(undefined, verbose, 'Plugin logic started.') |
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.
logs is undefined when inside the plugin's child process, which is normal.
| 1. ./plugin (onPreBuild event) ␊ | ||
| ────────────────────────────────────────────────────────────────␊ | ||
| ␊ | ||
| Step starting.␊ |
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.
Main process is about to send message to plugin process.
| ────────────────────────────────────────────────────────────────␊ | ||
| ␊ | ||
| Step starting.␊ | ||
| Step started.␊ |
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.
Main process successfully sent message to plugin process.
| ␊ | ||
| Step starting.␊ | ||
| Step started.␊ | ||
| Plugin logic started.␊ |
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.
Plugin process is about to execute plugin event handler.
| Step started.␊ | ||
| Plugin logic started.␊ | ||
| test␊ | ||
| Plugin logic ended.␊ |
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.
Plugin event handler completed.
| Plugin logic started.␊ | ||
| test␊ | ||
| Plugin logic ended.␊ | ||
| Stop closing.␊ |
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.
Plugin process is about to send its response message to the main process.
| Plugin logic ended.␊ | ||
| Stop closing.␊ | ||
| Step closed.␊ | ||
| Step ended.␊ |
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.
Main process received the plugin process's response message for this step.
| Stop closing.␊ | ||
| Step closed.␊ | ||
| Step ended.␊ | ||
| Step completed.␊ |
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.
Main process disconnected stdout/stderr from the plugin's process.
f6f1c0c to
e877683
Compare
JGAntunes
left a comment
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.
Left a comment which we can revisit later, but LGTM 👍
| debug: { | ||
| boolean: true, | ||
| describe: 'Print debugging information', | ||
| describe: 'Print user-facing debugging information', | ||
| hidden: true, | ||
| }, | ||
| verbose: { | ||
| boolean: true, | ||
| describe: 'Print internal debugging information', | ||
| hidden: true, | ||
| }, |
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.
Given the need for this ASAP I'm ok with the flag, but what do you think of having debug levels in the future? It would be more suited IMO vs these flags which can be confusing
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.
Yes, I was thinking this should be the next step as well!
Note than from a user standpoint, they use the NETLIFY_BUILD_DEBUG environment variable for both debug and verbose, so there's currently a single level from their perspective. The buildbot and CLI do not pass the verbose flag, so the only difference is for the tests, which sets verbose as false and debug as true.
Fixes #3933
This adds a
verboseCLI flag. The default value isfalse.It can be enabled with the environment variable
NETLIFY_BUILD_DEBUG=true(just like thedebugCLI flag). The reason this is using a separate CLI flag is because theverboseisfalsein tests whiledebugistrue, since verbose logs make test snapshots harder to read.The
verboseCLI flag has the same purpose as thedebugflag, but for more verbose log messages.At the moment, it prints messages indicating the different steps of plugins orchestration and IPC. This allows us to debug issues related to plugins hanging.
For us to review and ship your PR efficiently, please perform the following steps:
passes our tests.