DaanHoogland commented on code in PR #6825:
URL: https://github.com/apache/cloudstack/pull/6825#discussion_r994257287


##########
usage/src/main/java/com/cloud/usage/UsageSanityChecker.java:
##########
@@ -170,14 +188,21 @@ protected void checkSnapshotUsage() {
     }
 
     protected void readLastCheckId(){
+        if (s_logger.isDebugEnabled()) {
+            s_logger.debug("reading last checked id for sanity check");
+        }
         try(BufferedReader reader = new BufferedReader(new 
FileReader(lastCheckFile));) {
             String lastIdText = null;
             lastId = -1;
-            if ((reader != null) && (lastIdText = reader.readLine()) != null) {
+            if ((lastIdText = reader.readLine()) != null) {
                 lastId = Integer.parseInt(lastIdText);
             }
         } catch (Exception e) {
-            s_logger.error("readLastCheckId:Exception:"+e.getMessage(),e);
+            String msg = String.format("error reading the LastCheckId reason: 
%s", e.getMessage());
+            s_logger.error(msg);
+            s_logger.debug(msg, e);
+        } finally {
+            s_logger.info(String.format("using %d as last checked id to start 
from in sanity check", lastId));

Review Comment:
   This is excessive capitalisation to me, I won´t apply.



-- 
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