Copilot commented on code in PR #14226:
URL: https://github.com/apache/cloudstack/pull/14226#discussion_r4082079381


##########
plugins/hypervisors/kvm/src/main/java/org/apache/cloudstack/utils/linux/KVMHostInfo.java:
##########
@@ -252,12 +253,21 @@ private void getHostInfoFromLibvirt() {
             */
             this.capabilities.add("snapshot");
         } catch (final LibvirtException e) {
-            LOGGER.error("Caught libvirt exception while fetching host 
information", e);
+            LOGGER.error("Caught Libvirt exception while fetching host 
information", e);
         }
     }
 
     private String getCPUArchFromCommand() {
         LOGGER.info("Fetching host CPU arch");
         return 
Script.runSimpleBashScript(Script.getExecutableAbsolutePath(cpuArchRetrieveExecutable));
     }
+
+    private static void logCpuSpeedCommandAndSpeed(String command, long speed) 
{
+        LOGGER.info("Command [{}] resulted in the value [{}] for CPU speed.", 
command, speed);
+    }
+
+    private static void logFailureToGetCpuSpeedAndException(String command, 
Exception e) {
+        LOGGER.debug("Unable to retrieve the CPU speed from command [{}]. 
Trying another way to retrieve the CPU speed.", command);
+        LOGGER.trace(e);

Review Comment:
   `LOGGER.trace(e);` logs the exception object as the message (typically only 
`toString()`), and does not reliably include the stack trace/context. Prefer 
logging the throwable via an overload that accepts a throwable (e.g., include 
`e` as the throwable parameter in the same log statement), so failures preserve 
stack traces at the intended log level.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to