IBM Mgmt console lock algorithm improvement

This commit optimizes the release lock code and adds some traces to give
more data for lock conflict scenarios

Tested by:
 1. With dual client connected, verified the conflicts are returned
 2. Tested releaseLock usecase

Signed-off-by: Sunitha Harish <sunithaharish04@gmail.com>
Change-Id: I3cf99aaa5cc7c2967ae8dbc9c76c9f7378ecebdd
diff --git a/include/ibm/management_console_rest.hpp b/include/ibm/management_console_rest.hpp
index e51f64a..0a8b146 100644
--- a/include/ibm/management_console_rest.hpp
+++ b/include/ibm/management_console_rest.hpp
@@ -488,7 +488,7 @@
         }
         if (validityStatus.first && (validityStatus.second == 1))
         {
-            BMCWEB_LOG_DEBUG << "There is a conflict within itself";
+            BMCWEB_LOG_ERROR << "There is a conflict within itself";
             asyncResp->res.result(boost::beast::http::status::conflict);
             return;
         }
@@ -529,7 +529,7 @@
         }
 
         returnJson["SegmentFlags"] = myarray;
-
+        BMCWEB_LOG_ERROR << "Conflicting lock record: " << returnJson;
         asyncResp->res.jsonValue["Record"] = returnJson;
         return;
     }
@@ -563,6 +563,7 @@
     if (!varReleaselock.first)
     {
         // validation Failed
+        BMCWEB_LOG_ERROR << "handleReleaseLockAPI: validation failed";
         asyncResp->res.result(boost::beast::http::status::bad_request);
         return;
     }
@@ -597,6 +598,7 @@
     }
 
     returnJson["SegmentFlags"] = myArray;
+    BMCWEB_LOG_DEBUG << "handleReleaseLockAPI: lockrecord: " << returnJson;
     asyncResp->res.jsonValue["Record"] = returnJson;
 }