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

ConsoleReporter sends INFO to stdout #20328

Merged
merged 1 commit into from
May 7, 2024

Conversation

som-snytt
Copy link
Contributor

Fixes #16701

Tested only manually.

For example, with tailrec printer enabled,

scalac -Vprint:typer example.scala > x 2> y

puts tree output and tailrec trace in x, warnings & errors & summary count in y.

x is the output I asked for. This makes it easier to see trace and trees correctly interleaved, since > out 2>&1 does not guarantee it.

Tests may depend on how output is captured. Scala 2 partest captures stderr to log, for example.

@som-snytt som-snytt force-pushed the issue/16701-vprint-stdout branch from 528753d to 1f7a69e Compare May 3, 2024 09:34
@som-snytt
Copy link
Contributor Author

som-snytt commented May 3, 2024

The "42 warnings found" message was INFO (undesired) and now WARN, but override in test reporter as no-op, as it is not needed for testing. (There must be 42 "warn" annotations. We assume the reporter knows how to count.) (On scala 2, the summary message is in the check file.)

In scala 2, ConsoleReporter#finish outputs the count. IIRC finish was introduced for just this purpose, a reporter-specific "footer" message. Here, doReport is used by Reporter#printSummary as a direct channel, since this message is not itself a countable warning. By contrast, summarizeUnreportedWarnings is a countable warning.

@som-snytt som-snytt marked this pull request as ready for review May 3, 2024 13:59
@Gedochao Gedochao requested a review from rochala May 7, 2024 13:29
@rochala rochala merged commit e85fa42 into scala:main May 7, 2024
19 checks passed
@som-snytt som-snytt deleted the issue/16701-vprint-stdout branch May 7, 2024 14:52
@Kordyjan Kordyjan added this to the 3.5.0 milestone May 10, 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
3 participants