convert globalhandler.cpp to use lg2

Signed-off-by: George Liu <liuxiwei@ieisystem.com>
Change-Id: I813779ee83fa19df01afd0b5c1cfd6294d3be777
diff --git a/globalhandler.cpp b/globalhandler.cpp
index 992bdd8..63767c7 100644
--- a/globalhandler.cpp
+++ b/globalhandler.cpp
@@ -2,9 +2,7 @@
 
 #include <ipmid/api.hpp>
 #include <ipmid/utils.hpp>
-#include <phosphor-logging/elog-errors.hpp>
-#include <phosphor-logging/log.hpp>
-#include <xyz/openbmc_project/Common/error.hpp>
+#include <phosphor-logging/lg2.hpp>
 #include <xyz/openbmc_project/State/BMC/server.hpp>
 
 #include <string>
@@ -14,7 +12,6 @@
 static constexpr auto reqTransition = "RequestedBMCTransition";
 static constexpr auto match = "bmc0";
 
-using namespace phosphor::logging;
 using BMC = sdbusplus::server::xyz::openbmc_project::state::BMC;
 
 void register_netfn_global_functions() __attribute__((constructor));
@@ -45,7 +42,7 @@
     }
     catch (const std::exception& e)
     {
-        log<level::ERR>(e.what());
+        lg2::error("Exception in Global Reset: {ERROR}", "ERROR", e);
         return ipmi::responseUnspecifiedError();
     }