From ccc9b9d65623d454d987185af4e14ce26a67fa53 Mon Sep 17 00:00:00 2001 From: Googler Date: Thu, 9 Dec 2021 13:57:30 -0800 Subject: [PATCH] Automatic code cleanup. PiperOrigin-RevId: 415349792 --- .../devtools/build/lib/analysis/test/TestRunnerAction.java | 2 +- .../build/lib/platform/SystemLoadAdvisoryModule.java | 6 +++--- .../build/lib/platform/SystemMemoryPressureMonitor.java | 2 +- .../devtools/build/lib/platform/SystemSuspensionModule.java | 2 +- .../devtools/build/lib/platform/SystemThermalModule.java | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/google/devtools/build/lib/analysis/test/TestRunnerAction.java b/src/main/java/com/google/devtools/build/lib/analysis/test/TestRunnerAction.java index 7ccf134bc01a16..ebed92e7b6ad82 100644 --- a/src/main/java/com/google/devtools/build/lib/analysis/test/TestRunnerAction.java +++ b/src/main/java/com/google/devtools/build/lib/analysis/test/TestRunnerAction.java @@ -608,7 +608,7 @@ public boolean actionCacheHit(ActionCachedContext executor) { .getContext(TestActionContext.class) .newCachedTestResult(executor.getExecRoot(), this, cachedTestResultData.get())); } catch (IOException e) { - logger.atInfo().log(getErrorMessageOnNewCachedTestResultError(e.getMessage())); + logger.atInfo().log("%s", getErrorMessageOnNewCachedTestResultError(e.getMessage())); executor .getEventHandler() .handle(Event.warn(getErrorMessageOnNewCachedTestResultError(e.getMessage()))); diff --git a/src/main/java/com/google/devtools/build/lib/platform/SystemLoadAdvisoryModule.java b/src/main/java/com/google/devtools/build/lib/platform/SystemLoadAdvisoryModule.java index 529118aa430173..0675dd6ba11700 100644 --- a/src/main/java/com/google/devtools/build/lib/platform/SystemLoadAdvisoryModule.java +++ b/src/main/java/com/google/devtools/build/lib/platform/SystemLoadAdvisoryModule.java @@ -95,13 +95,13 @@ private synchronized void reportSystemLoadAdvisoryEvent(boolean isInitialValue, if (value < 0 || value > 100) { // values outside this range are not expected. - logger.atSevere().log(logString); + logger.atSevere().log("%s", logString); } else if (value > 50) { // 50 arbitrarily chosen as point where user is likely to be more concerned. - logger.atWarning().log(logString); + logger.atWarning().log("%s", logString); } else if (!isInitialValue || value > 25) { // Don't spam the logs if we have a Great or OK value at startup. - logger.atInfo().log(logString); + logger.atInfo().log("%s", logString); } if (reporter != null) { reporter.post(event); diff --git a/src/main/java/com/google/devtools/build/lib/platform/SystemMemoryPressureMonitor.java b/src/main/java/com/google/devtools/build/lib/platform/SystemMemoryPressureMonitor.java index 9e1b31f92c260d..11010cfa450a29 100644 --- a/src/main/java/com/google/devtools/build/lib/platform/SystemMemoryPressureMonitor.java +++ b/src/main/java/com/google/devtools/build/lib/platform/SystemMemoryPressureMonitor.java @@ -59,7 +59,7 @@ synchronized void memoryPressureCallback(int value) { if (reporter != null) { reporter.post(event); } - logger.atInfo().log(event.logString()); + logger.atInfo().log("%s", event.logString()); eventCount += 1; } } diff --git a/src/main/java/com/google/devtools/build/lib/platform/SystemSuspensionModule.java b/src/main/java/com/google/devtools/build/lib/platform/SystemSuspensionModule.java index 82d0a2c070ff1b..84a91de72202bb 100644 --- a/src/main/java/com/google/devtools/build/lib/platform/SystemSuspensionModule.java +++ b/src/main/java/com/google/devtools/build/lib/platform/SystemSuspensionModule.java @@ -55,7 +55,7 @@ public synchronized void afterCommand() { /** Callback method called from JNI whenever a suspension event occurs. */ synchronized void suspendCallback(int reason) { SystemSuspensionEvent event = new SystemSuspensionEvent(reason); - logger.atInfo().log(event.logString()); + logger.atInfo().log("%s", event.logString()); if (reporter != null) { reporter.post(event); } diff --git a/src/main/java/com/google/devtools/build/lib/platform/SystemThermalModule.java b/src/main/java/com/google/devtools/build/lib/platform/SystemThermalModule.java index 59f41d8c004bde..000b82e6898928 100644 --- a/src/main/java/com/google/devtools/build/lib/platform/SystemThermalModule.java +++ b/src/main/java/com/google/devtools/build/lib/platform/SystemThermalModule.java @@ -102,13 +102,13 @@ private synchronized void reportThermalEvent(boolean isInitialValue, int value) if (value < 0 || value > 100) { // values outside this range are not expected. - logger.atSevere().log(logString); + logger.atSevere().log("%s", logString); } else if (value > 50) { // 50 arbitrarily chosen as point where user is likely to be more concerned. - logger.atWarning().log(logString); + logger.atWarning().log("%s", logString); } else if (!isInitialValue || value != 0) { // Don't spam the logs if we have a nominal value at startup. - logger.atInfo().log(logString); + logger.atInfo().log("%s", logString); } if (reporter != null) { reporter.post(event);