Skip to content

Cleanup debug log handling #21

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

Merged
merged 2 commits into from
Jun 3, 2019
Merged
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 @@ -859,11 +859,14 @@ else if ( CompilerConfiguration.CompilerReuseStrategy.ReuseSame.getStrategy().eq
{
// MCOMPILER-366: if sources contain the module-descriptor it must be used to define the modulepath
sources = getCompileSources( compiler, compilerConfiguration );

getLog().debug( "#sources: " + sources.size() );
for ( File file : sources )

if ( getLog().isDebugEnabled() )
{
getLog().debug( file.getPath() );
getLog().debug( "#sources: " + sources.size() );
for ( File file : sources )
{
getLog().debug( file.getPath() );
}
}

preparePaths( sources );
Expand Down Expand Up @@ -960,7 +963,7 @@ else if ( CompilerConfiguration.CompilerReuseStrategy.ReuseSame.getStrategy().eq
}

String[] cl = compiler.createCommandLine( compilerConfiguration );
if ( getLog().isDebugEnabled() && cl != null && cl.length > 0 )
if ( cl != null && cl.length > 0 )
Copy link
Contributor

Choose a reason for hiding this comment

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

I would prefer to keep the getLog().isDebugEnabled() here, otherwise a lot a String concatenation is done for showing the commandline, which is only shown during debug

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, good catch!

{
StringBuilder sb = new StringBuilder();
sb.append( cl[0] );
Expand Down