Skip to content
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

scala 3 compiler version msg is written to stdout, not stderr #18845

Closed
wants to merge 3 commits into from

Conversation

ncgl-git
Copy link

@ncgl-git ncgl-git commented Nov 4, 2023

Targets issue 16701

New to Scala, looking for constructive criticism and suggestions if this is a bad way to do this!

@ncgl-git ncgl-git changed the title scala 3 compiler is written to stdout, not stderr scala 3 compiler version msg is written to stdout, not stderr Nov 4, 2023
@nicolasstucki nicolasstucki linked an issue Nov 6, 2023 that may be closed by this pull request
@@ -130,7 +132,8 @@ trait CliCommand:
report.echo(ifErrorsMsg)
None
else if settings.version.value then
report.echo(versionMsg)
// ctx defaults to Console.err
ConsoleReporter(writer = new PrintWriter(Console.out, true)).printMessage(versionMsg)
Copy link
Member

@bishabosha bishabosha Nov 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be handled by the reporter instead, then in the ConsoleReporter you can add an extra writer for where echo messages go (set to Console.out by default), and intercept Info diagnostics in doReport to send to the echo writer. This is what Scala 2 does.

Typically we do want all echo messages to go be visible in the same UI as the warnings/errors (e.g. in an IDE so you get the info messages in a dedicated window, rather than suddenly an extra Console.out log appearing).

@bishabosha bishabosha assigned ncgl-git and unassigned bishabosha Nov 27, 2023
@SethTisue SethTisue marked this pull request as draft March 25, 2024 12:06
@som-snytt
Copy link
Contributor

Superseded by #20328

I was looking for a good first issue. Thanks for taking a first swing. I think I took bishabosha's constructive criticism.

@som-snytt som-snytt closed this May 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Output should distinguish stdout and stderr
4 participants