Cleanup old logging headers and namespaces

Remove the header includes for the old phosphor::logging::log API
as well as unnecessary phosphor::logging namespace declarations.
Fully qualify phosphor::logging namespace where applicable and/or
needed.

Tested:
* Verified commit passed CI unit tests.
* Verified commit built using bitbake.

Change-Id: Ibf35b653192054e8654366ee09842992a598d9af
Signed-off-by: Anwaar Hadi <anwaar.hadi@ibm.com>
diff --git a/device_monitor.hpp b/device_monitor.hpp
index ec0151c..9f06a96 100644
--- a/device_monitor.hpp
+++ b/device_monitor.hpp
@@ -1,7 +1,6 @@
 #pragma once
 #include "device.hpp"
 
-#include <phosphor-logging/log.hpp>
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/server.hpp>
 #include <sdeventplus/clock.hpp>
@@ -13,8 +12,6 @@
 namespace power
 {
 
-using namespace phosphor::logging;
-
 /**
  * @class DeviceMonitor
  *
diff --git a/elog-errors.hpp b/elog-errors.hpp
index 6632a27..90d7daa 100644
--- a/elog-errors.hpp
+++ b/elog-errors.hpp
@@ -3,7 +3,6 @@
 #pragma once
 
 #include <phosphor-logging/elog.hpp>
-#include <phosphor-logging/log.hpp>
 #include <sdbusplus/exception.hpp>
 
 #include <string>
diff --git a/phosphor-power-supply/main.cpp b/phosphor-power-supply/main.cpp
index 6d7c853..9dfe476 100644
--- a/phosphor-power-supply/main.cpp
+++ b/phosphor-power-supply/main.cpp
@@ -28,8 +28,6 @@
 {
     try
     {
-        using namespace phosphor::logging;
-
         CLI::App app{"OpenBMC Power Supply Unit Monitor"};
 
         auto bus = sdbusplus::bus::new_default();
diff --git a/phosphor-power-supply/power_supply.cpp b/phosphor-power-supply/power_supply.cpp
index 331b4ba..65e7b62 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -22,7 +22,6 @@
 // missing to present before running the bind command(s).
 constexpr auto bindDelay = 1000;
 
-using namespace phosphor::logging;
 using namespace sdbusplus::xyz::openbmc_project::Common::Device::Error;
 
 PowerSupply::PowerSupply(
diff --git a/phosphor-power-supply/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index 51cb5cb..1f72440 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -14,8 +14,6 @@
 #include <regex>
 #include <set>
 
-using namespace phosphor::logging;
-
 namespace phosphor::power::manager
 {
 constexpr auto managerBusName = "xyz.openbmc_project.Power.PSUMonitor";
diff --git a/phosphor-power-supply/psu_manager.hpp b/phosphor-power-supply/psu_manager.hpp
index 01c56c2..d86e0e2 100644
--- a/phosphor-power-supply/psu_manager.hpp
+++ b/phosphor-power-supply/psu_manager.hpp
@@ -20,7 +20,6 @@
 };
 
 using namespace phosphor::power::psu;
-using namespace phosphor::logging;
 
 namespace phosphor::power::manager
 {
diff --git a/phosphor-power-supply/util.cpp b/phosphor-power-supply/util.cpp
index 73c7ff5..35c35ca 100644
--- a/phosphor-power-supply/util.cpp
+++ b/phosphor-power-supply/util.cpp
@@ -41,8 +41,6 @@
 
 int GPIOInterface::read()
 {
-    using namespace phosphor::logging;
-
     int value = -1;
 
     if (!line)
@@ -79,8 +77,6 @@
 
 void GPIOInterface::write(int value, std::bitset<32> flags)
 {
-    using namespace phosphor::logging;
-
     if (!line)
     {
         lg2::error("Failed line in GPIOInterface::write");
diff --git a/phosphor-power-supply/util.hpp b/phosphor-power-supply/util.hpp
index 58bab67..dc28ffe 100644
--- a/phosphor-power-supply/util.hpp
+++ b/phosphor-power-supply/util.hpp
@@ -41,7 +41,6 @@
     void setPresence(sdbusplus::bus_t& bus, const std::string& invpath,
                      bool present, const std::string& name) const override
     {
-        using namespace phosphor::logging;
         lg2::info("Updating inventory present property. "
                   "present:{PRESENT} invpath:{INVPATH} name:{NAME}",
                   "PRESENT", present, "INVPATH", invpath, "NAME", name);
@@ -81,7 +80,7 @@
             lg2::error(
                 "Error in inventory manager call to update inventory: {ERROR}",
                 "ERROR", e);
-            elog<InternalFailure>();
+            phosphor::logging::elog<InternalFailure>();
         }
     }
 
@@ -110,7 +109,6 @@
         }
         catch (const sdbusplus::exception_t& e)
         {
-            using namespace phosphor::logging;
             lg2::error("Error in inventory manager call to update "
                        "availability interface: {ERROR}",
                        "ERROR", e);
@@ -181,7 +179,6 @@
         }
         catch (const sdbusplus::exception_t& e)
         {
-            using namespace phosphor::logging;
             lg2::info("Error trying to handle health rollup "
                       "associations for {INVPATH}: {ERROR}",
                       "INVPATH", invpath, "ERROR", e);
diff --git a/power-sequencer/main.cpp b/power-sequencer/main.cpp
index 039a102..22a337b 100644
--- a/power-sequencer/main.cpp
+++ b/power-sequencer/main.cpp
@@ -27,7 +27,6 @@
 #include <iostream>
 
 using namespace phosphor::power;
-using namespace phosphor::logging;
 
 int main(int argc, char** argv)
 {
diff --git a/power-sequencer/pgood_monitor.cpp b/power-sequencer/pgood_monitor.cpp
index acceb6b..d1a80c2 100644
--- a/power-sequencer/pgood_monitor.cpp
+++ b/power-sequencer/pgood_monitor.cpp
@@ -31,7 +31,6 @@
 constexpr auto POWER_OBJ_PATH = "/org/openbmc/control/power0";
 constexpr auto POWER_INTERFACE = "org.openbmc.control.Power";
 
-using namespace phosphor::logging;
 using namespace sdbusplus::org::open_power::Witherspoon::Fault::Error;
 
 bool PGOODMonitor::pgoodPending()
@@ -70,7 +69,7 @@
 #ifdef DEVICE_ACCESS
         device->onFailure();
 #endif
-        report<PowerOnFailure>();
+        phosphor::logging::report<PowerOnFailure>();
     }
 
     // The pgood-wait service (with a longer timeout)
diff --git a/power-sequencer/runtime_monitor.cpp b/power-sequencer/runtime_monitor.cpp
index 7fa8665..8242c22 100644
--- a/power-sequencer/runtime_monitor.cpp
+++ b/power-sequencer/runtime_monitor.cpp
@@ -28,7 +28,6 @@
 namespace power
 {
 
-using namespace phosphor::logging;
 using namespace sdbusplus::org::open_power::Witherspoon::Fault::Error;
 
 int RuntimeMonitor::run()
diff --git a/power-supply/main.cpp b/power-supply/main.cpp
index 9049fd6..5393198 100644
--- a/power-supply/main.cpp
+++ b/power-supply/main.cpp
@@ -24,7 +24,6 @@
 #include <iostream>
 
 using namespace phosphor::power;
-using namespace phosphor::logging;
 
 int main(int argc, char* argv[])
 {
diff --git a/tools/power-utils/aei_updater.cpp b/tools/power-utils/aei_updater.cpp
index a98a1d8..4b1865b 100644
--- a/tools/power-utils/aei_updater.cpp
+++ b/tools/power-utils/aei_updater.cpp
@@ -68,7 +68,6 @@
 constexpr uint8_t B_ISP_MODE_CHKSUM_GOOD = 0x41; // ISP mode  & good checksum.
 constexpr uint8_t SUCCESSFUL_ISP_REBOOT_STATUS = 0x0; // Successful ISP reboot
                                                       // status
-using namespace phosphor::logging;
 namespace util = phosphor::power::util;
 
 int AeiUpdater::doUpdate()
diff --git a/tools/power-utils/main.cpp b/tools/power-utils/main.cpp
index ca8a6fe..adc4bb8 100644
--- a/tools/power-utils/main.cpp
+++ b/tools/power-utils/main.cpp
@@ -26,8 +26,6 @@
 #include <cassert>
 #include <filesystem>
 
-using namespace phosphor::logging;
-
 int main(int argc, char** argv)
 {
     std::string psuPathVersion, psuPathModel;
diff --git a/tools/power-utils/model.cpp b/tools/power-utils/model.cpp
index 507e585..7875564 100644
--- a/tools/power-utils/model.cpp
+++ b/tools/power-utils/model.cpp
@@ -32,7 +32,6 @@
 using json = nlohmann::json;
 
 using namespace utils;
-using namespace phosphor::logging;
 using namespace phosphor::power::util;
 
 namespace model
diff --git a/tools/power-utils/updater.cpp b/tools/power-utils/updater.cpp
index 07e74e9..2587ae9 100644
--- a/tools/power-utils/updater.cpp
+++ b/tools/power-utils/updater.cpp
@@ -33,7 +33,6 @@
 #include <map>
 #include <string>
 
-using namespace phosphor::logging;
 namespace util = phosphor::power::util;
 
 namespace updater
diff --git a/tools/power-utils/utils.cpp b/tools/power-utils/utils.cpp
index d643dbf..a398363 100644
--- a/tools/power-utils/utils.cpp
+++ b/tools/power-utils/utils.cpp
@@ -32,7 +32,6 @@
 #include <sstream>
 #include <stdexcept>
 
-using namespace phosphor::logging;
 using namespace phosphor::power::util;
 using namespace sdbusplus::xyz::openbmc_project::Common::Device::Error;
 namespace fs = std::filesystem;
diff --git a/tools/power-utils/version.cpp b/tools/power-utils/version.cpp
index 3a08bc3..9a45beb 100644
--- a/tools/power-utils/version.cpp
+++ b/tools/power-utils/version.cpp
@@ -30,7 +30,6 @@
 using json = nlohmann::json;
 
 using namespace utils;
-using namespace phosphor::logging;
 using namespace phosphor::power::util;
 
 namespace version
diff --git a/utility.cpp b/utility.cpp
index c2d7815..0cee1bf 100644
--- a/utility.cpp
+++ b/utility.cpp
@@ -30,7 +30,6 @@
 constexpr auto MAPPER_PATH = "/xyz/openbmc_project/object_mapper";
 constexpr auto MAPPER_INTERFACE = "xyz.openbmc_project.ObjectMapper";
 
-using namespace phosphor::logging;
 using json = nlohmann::json;
 
 std::string getService(const std::string& path, const std::string& interface,