-
Notifications
You must be signed in to change notification settings - Fork 22
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
[BREAKING] Replace console.log with process.stderr #686
Conversation
@RandomByte what was the reason here when implementing the logging here not choosing ui5-logger? |
My assumption is that we want "clear" messages and always to output something. This is the code in the logger: Basically, if the log level is If my assumptions are invalid, please correct me and if there are no other objections, I'm perfectly fine to go with the |
I'm pretty sure this is a relic from the time where The fact that we used console.log (writing to stdout instead of stderr) was a mistake I think. Yavor perfectly outlined the differences. But I somehow suspect that a user would expect that for log level "silent" we don't even log error messages. If we don't see any technical issues with switching to |
When I run
Am I doing something wrong? |
35bb0d1
to
c2455db
Compare
Yavor and myself just discussed this and came to the conclusion to revert back to directly writing the error messages to process.stderr. This is already an improvement from before, where errors were written to stdout. The main rational for not using Some of the commands always write their output do stdout ( |
It was just a try to provide cleaner messages for the Logger. It seems that if we want to achieve this via the Logger, the complexity of the code would increase. We discussed this with @RandomByte and it seems unreasonable to continue with that. Reverting back to |
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 went over the PR again. I think whenever we write the "main result" of a command, we should write it to stdout.
Any additional log messages as well as error messages should go to stderr. Basically anything that can't be parsed the same way as the standard output of the command.
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.
Looks good to me and matches my expectations. Thanks!
BREAKING CHANGE: Messages will now be written to stderr instead of stdout. JIRA: CPOUI5FOUNDATION-802 Related to: SAP/ui5-tooling#701 Sibling of: SAP/ui5-tooling#930, SAP/ui5-cli#686
BREAKING CHANGE:
System messages will now be written to stderr instead of stdout.
JIRA: CPOUI5FOUNDATION-802
Related to: SAP/ui5-tooling#701
Sibling of: SAP/ui5-server#643, SAP/ui5-tooling#930