perf: Logging statements to use parameterized messages (#4399)

This commit is contained in:
Balázs Szücs
2025-09-28 22:17:58 +02:00
committed by GitHub
parent d5a3f768bc
commit e44d5f3714
10 changed files with 25 additions and 29 deletions

View File

@@ -119,7 +119,7 @@ public class DesktopBrowser implements WebBrowser {
private void configureCefSettings(CefAppBuilder builder) {
CefSettings settings = builder.getCefSettings();
String basePath = InstallationPathConfig.getClientWebUIPath();
log.info("basePath " + basePath);
log.info("basePath {}", basePath);
settings.cache_path = new File(basePath + "cache").getAbsolutePath();
settings.root_cache_path = new File(basePath + "root_cache").getAbsolutePath();
// settings.browser_subprocess_path = new File(basePath +
@@ -136,7 +136,7 @@ public class DesktopBrowser implements WebBrowser {
new MavenCefAppHandlerAdapter() {
@Override
public void stateHasChanged(org.cef.CefApp.CefAppState state) {
log.info("CEF state changed: " + state);
log.info("CEF state changed: {}", state);
if (state == CefApp.CefAppState.TERMINATED) {
System.exit(0);
}
@@ -163,9 +163,9 @@ public class DesktopBrowser implements WebBrowser {
CefDownloadItem downloadItem,
CefDownloadItemCallback callback) {
if (downloadItem.isComplete()) {
log.info("Download completed: " + downloadItem.getFullPath());
log.info("Download completed: {}", downloadItem.getFullPath());
} else if (downloadItem.isCanceled()) {
log.info("Download canceled: " + downloadItem.getFullPath());
log.info("Download canceled: {}", downloadItem.getFullPath());
}
}
});
@@ -409,7 +409,7 @@ public class DesktopBrowser implements WebBrowser {
}
}
} catch (Exception e) {
log.debug("Could not load icon from " + path, e);
log.debug("Could not load icon from {}", path, e);
}
}

View File

@@ -227,9 +227,7 @@ public class LoadingWindow extends JDialog {
if (!existingPids
.contains(
pid)) {
log.debug(
"Found new explorer.exe with PID: "
+ pid);
log.debug("Found new explorer.exe with PID: {}", pid);
ProcessBuilder
killProcess =
new ProcessBuilder(
@@ -247,9 +245,7 @@ public class LoadingWindow extends JDialog {
2,
TimeUnit
.SECONDS);
log.debug(
"Explorer process terminated: "
+ pid);
log.debug("Explorer process terminated: {}", pid);
}
}
}
@@ -320,7 +316,7 @@ public class LoadingWindow extends JDialog {
mainPanel.revalidate();
mainPanel.repaint();
} catch (Exception e) {
log.error("Error updating progress to " + progress, e);
log.error("Error updating progress to {}", progress, e);
}
});
}
@@ -345,7 +341,7 @@ public class LoadingWindow extends JDialog {
mainPanel.revalidate();
mainPanel.repaint();
} catch (Exception e) {
log.error("Error updating status to: " + status, e);
log.error("Error updating status to: {}", status, e);
}
});
}

View File

@@ -263,8 +263,8 @@ public class RearrangePagesPDFController {
} else {
newPageOrder = GeneralUtils.parsePageList(pageOrderArr, totalPages, false);
}
log.info("newPageOrder = " + newPageOrder);
log.info("totalPages = " + totalPages);
log.info("newPageOrder = {}", newPageOrder);
log.info("totalPages = {}", totalPages);
// Create a new list to hold the pages in the new order
List<PDPage> newPages = new ArrayList<>();
for (int i = 0; i < newPageOrder.size(); i++) {

View File

@@ -806,7 +806,7 @@ public class CompressController {
try {
Files.deleteIfExists(tempFile);
} catch (IOException e) {
log.warn("Failed to delete temporary file: " + tempFile, e);
log.warn("Failed to delete temporary file: {}", tempFile, e);
}
}
}

View File

@@ -219,7 +219,7 @@ public class ExtractImageScansController {
try {
Files.deleteIfExists(path);
} catch (IOException e) {
log.error("Failed to delete temporary image file: " + path, e);
log.error("Failed to delete temporary image file: {}", path, e);
}
});
@@ -227,7 +227,7 @@ public class ExtractImageScansController {
try {
Files.deleteIfExists(tempZipFile);
} catch (IOException e) {
log.error("Failed to delete temporary zip file: " + tempZipFile, e);
log.error("Failed to delete temporary zip file: {}", tempZipFile, e);
}
}
@@ -236,7 +236,7 @@ public class ExtractImageScansController {
try {
FileUtils.deleteDirectory(dir.toFile());
} catch (IOException e) {
log.error("Failed to delete temporary directory: " + dir, e);
log.error("Failed to delete temporary directory: {}", dir, e);
}
});
}

View File

@@ -68,7 +68,7 @@ public class PrintFileController {
new IllegalArgumentException(
"No matching printer found"));
log.info("Selected Printer: " + selectedService.getName());
log.info("Selected Printer: {}", selectedService.getName());
if (MediaType.APPLICATION_PDF_VALUE.equals(contentType)) {
PDDocument document = Loader.loadPDF(file.getBytes());

View File

@@ -339,7 +339,7 @@ public class PipelineProcessor {
}
Path path = Paths.get(file.getAbsolutePath());
// debug statement
log.info("Reading file: " + path);
log.info("Reading file: {}", path);
if (Files.exists(path)) {
Resource fileResource =
new ByteArrayResource(Files.readAllBytes(path)) {
@@ -351,7 +351,7 @@ public class PipelineProcessor {
};
outputFiles.add(fileResource);
} else {
log.info("File not found: " + path);
log.info("File not found: {}", path);
}
}
log.info("Files successfully loaded. Starting processing...");