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

Log all compiler output at debug level #296

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,10 @@ protected CompilerResult compileOutOfProcess(CompilerConfiguration config, Strin
try {
returnCode = CommandLineUtils.executeCommandLine(cli, out, out);

if (getLog().isDebugEnabled()) {
getLog().debug("Compiler output:{}{}", EOL, out.getOutput());
}

messages = parseModernStream(returnCode, new BufferedReader(new StringReader(out.getOutput())));
} catch (CommandLineException | IOException e) {
throw new CompilerException("Error while executing the external compiler.", e);
Expand Down Expand Up @@ -587,7 +591,7 @@ protected CompilerResult compileInProcessWithProperClassloader(Class<?> javacCla
/**
* Helper method for compileInProcess()
*/
private static CompilerResult compileInProcess0(Class<?> javacClass, String[] args) throws CompilerException {
private CompilerResult compileInProcess0(Class<?> javacClass, String[] args) throws CompilerException {
StringWriter out = new StringWriter();

Integer ok;
Expand All @@ -599,6 +603,10 @@ private static CompilerResult compileInProcess0(Class<?> javacClass, String[] ar

ok = (Integer) compile.invoke(null, new Object[] {args, new PrintWriter(out)});

if (getLog().isDebugEnabled()) {
getLog().debug("Compiler output:{}{}", EOL, out.toString());
}

messages = parseModernStream(ok, new BufferedReader(new StringReader(out.toString())));
} catch (NoSuchMethodException | IOException | InvocationTargetException | IllegalAccessException e) {
throw new CompilerException("Error while executing the compiler.", e);
Expand Down