-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Printing process warning's via the appropriate loggers #8746
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,4 +21,4 @@ if [ ! -x "$NODE" ]; then | |
exit 1 | ||
fi | ||
|
||
exec "${NODE}" $NODE_OPTIONS "${DIR}/src/cli_plugin" ${@} | ||
exec "${NODE}" $NODE_OPTIONS --no-warnings "${DIR}/src/cli_plugin" ${@} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The kibana-plugin is currently not displaying the warnings at all, currently investigating the best way to determine if "we're in production" There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The cli plugin command has it's own logger with it's own opinions about when messages should and shouldn't be logged (controlled with We should probably wire this up in that cli |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function (settings, logger) { | ||
process.on('warning', (warning) => { | ||
logger.error(warning); | ||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default function (kbnServer, server, config) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm assuming that we only have one instance of the kbnServer per 'process' (including when we're clustering) so we won't be subscribing to this event twice and possibly getting duplicate warnings. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Not necessarily, but I don't think there is a better option right now. |
||
process.on('warning', (warning) => { | ||
server.log(['warning', 'process'], warning); | ||
}); | ||
} |
Uh oh!
There was an error while loading. Please reload this page.
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 haven't been able to find a way to selectively add this flag, besides potentially determining if the --dev flag is provided.
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 adding the flag all the time is fine, since we are forwarding all the messages via the server logger.