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

Write raw javac output to a log file #297

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mensinda
Copy link

@mensinda mensinda commented Jul 6, 2023

Sometimes it is useful to look at the raw javac output when running in fork mode.

With this PR, the raw javac logs will be written to target/compiler-logs/javac_*.log

@olamy
Copy link
Member

olamy commented Sep 13, 2023

maybe it would be better as optional. when debug is activated?

@mensinda
Copy link
Author

Making this optional would be fine, but I would not use any existing CompilerConfiguration, since my use case is easily inspecting the raw compiler output with the current configuration (well, CompilerConfiguration#isVerbose could work...). However, I also don't think that adding a new option to the CompilerConfiguration is a good idea, since (currently) only a specific usage of the javac compiler is supported.

Maybe this could be controlled with a system property?

@slachiewicz
Copy link
Member

Hi, with 7cc5d40 we will have the output logged

@mensinda
Copy link
Author

Hi, writing the full log with with debug enabled does help somewhat, but is not enough for our use-case:

If I understand this correctly, the debug log would only trigger with mvn -X. While this would show the full compiler log, searching for it would be similar to searching for a needle in a haystack, since mvn -X is very verbose. In some projects, the output even exceeds the (default) scrollback line limit of most terminals.

Always, having the complete log in a separate file is, without having to recompile with different flags, is much easier to deal with. Especially in an organization, where not everyone has in-depth knowledge of the build tools.

Thus, I would prefer a solution where the logs are always written or at least configurable company wide with our parent POM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants