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

Fix incorrect logging calls #168

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
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
15 changes: 6 additions & 9 deletions src/main/java/com/redhat/red/build/koji/KojiClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public void setup()
{
objectMapper = new KojiObjectMapper();

logger.debug( "SETUP: Starting KojiClient for: " + config.getKojiURL() );
logger.debug( "SETUP: Starting KojiClient for: {}", config.getKojiURL() );
try
{
xmlrpcClient = new HC4SyncObjectClient( httpFactory, config.getKojiSiteConfig(), metricRegistry );
Expand All @@ -225,17 +225,14 @@ public void setup()

if ( 1 != response.getApiVersion() )
{
logger.error( "Cannot connect to koji at: " + config.getKojiURL() + ". API Version reported is '"
+ response.getApiVersion() + "' but this client only supports version 1." );
logger.error( "Cannot connect to koji at: {}. API Version reported is '{}' but this client only supports version 1.", config.getKojiURL(), response.getApiVersion() );
xmlrpcClient.close();
xmlrpcClient = null;
}
}
catch ( XmlRpcException e )
{
logger.error(
"Cannot retrieve koji API version from: " + config.getKojiURL() + ". (Reason: " + e.getMessage()
+ ")", e );
logger.error( "Cannot retrieve koji API version from: {}. (Reason: {})", config.getKojiURL(), e.getMessage(), e );
xmlrpcClient.close();
xmlrpcClient = null;
}
Expand Down Expand Up @@ -453,7 +450,7 @@ public void logout( KojiSessionInfo session )
}
catch ( XmlRpcException e )
{
logger.error( String.format( "Failed to logout: %s", e.getMessage() ), e );
logger.error( "Failed to logout: {}", e.getMessage(), e );
}
}

Expand All @@ -463,7 +460,7 @@ public void logout( KojiSessionInfo session )
}
catch ( DestroyFailedException e )
{
logger.error( String.format( "Failed to destroy session: %s", e.getMessage() ), e );
logger.error( "Failed to destroy session: {}", e.getMessage(), e );
}
}

Expand Down Expand Up @@ -618,7 +615,7 @@ public KojiImportResult importBuild( KojiImport importInfo, Iterable<Supplier<Im
}
catch ( RuntimeException e )
{
logger.error( "FAIL: " + e.getMessage(), e );
logger.error( "FAIL: {}", e.getMessage(), e );
throw e;
}
}, "Failed to execute content-generator import" );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ private <T> T doCall( final Object request, final Class<T> responseType, final U
}

final String content = new RWXMapper().render( request );
logger.trace( "Sending request:\n\n" + content + "\n\n" );
logger.trace( "Sending request:\n\n{}\n\n", content );

method.setEntity( new StringEntity( content ) );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public BuildSource parse( Object object )
String[] parts = String.valueOf( object ).split( "#" );
if ( parts.length < 2 || isEmpty( parts[0] ) || isEmpty( parts[1] ) )
{
logger.warn("Invalid build-source: '" + object + "'. Must be of format '<base-url>#<commit-ish>'");
logger.warn( "Invalid build-source: '{}'. Must be of format '<base-url>#<commit-ish>'", object );
}
BuildSource source = new BuildSource( parts[0] );
if ( parts.length > 1 )
Expand Down
Loading