use phosphor-logging
Migrate all instances of std::cerr and std::cout to phosphor-logging
such as lg2::error, lg2::info, lg2::debug, ...
The use of modern logging infrastructure helps with development since
additional logging levels such as `debug` and `warning` are available.
Migrating the remaining logging calls helps to make the code more
readable and uniform.
Tested: Inspection, and on Tyan S8030
Restarted EM with patch applied.
Logs appear as usual.
```
Sep 15 13:52:46 s8030-bmc-30303035c0c1 entity-manager[23480]: Inventory Added: Supermicro PWS 920P SQ 0
Sep 15 13:52:46 s8030-bmc-30303035c0c1 entity-manager[23480]: Inventory Added: Supermicro PWS 920P SQ 1
Sep 15 13:52:46 s8030-bmc-30303035c0c1 entity-manager[23480]: Inventory Added: Tyan S8030 Baseboard
Sep 15 13:52:46 s8030-bmc-30303035c0c1 entity-manager[23480]: Inventory Added: MBX 1.57 Chassis
```
`busctl tree` output appears as before.
Did a power cycle to trigger a few more log prints
```
Sep 15 13:55:14 s8030-bmc-30303035c0c1 entity-manager[23480]: power match triggered
```
Created configuration file with missing fields to trigger error print.
```
{
  "Exposes": [],
  "Type": "error"
}
```
```
Sep 15 13:56:58 s8030-bmc-30303035c0c1 entity-manager[23659]: Finished loading json configuration in 7938ms
Sep 15 13:56:58 s8030-bmc-30303035c0c1 entity-manager[23659]: configuration file missing probe:
                                                               {"Exposes":[],"Type":"error"}
Sep 15 13:56:59 s8030-bmc-30303035c0c1 entity-manager[23659]: configuration file missing probe:
                                                               {"Exposes":[],"Type":"error"}
```
Change-Id: I3452f983c9c14cd02ab9b56451c4b3e4a13c3979
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/src/entity_manager/overlay.cpp b/src/entity_manager/overlay.cpp
index 635a5b8..534c68f 100644
--- a/src/entity_manager/overlay.cpp
+++ b/src/entity_manager/overlay.cpp
@@ -17,7 +17,6 @@
 #include <filesystem>
 #include <fstream>
 #include <iomanip>
-#include <iostream>
 #include <regex>
 #include <string>
 
@@ -81,8 +80,8 @@
             devDir / ("channel-" + std::to_string(channelIndex));
         if (!is_symlink(channelPath))
         {
-            std::cerr << channelPath << " for mux channel " << channelName
-                      << " doesn't exist!\n";
+            lg2::error("{PATH} for mux channel {CHANNEL} doesn't exist!",
+                       "PATH", channelPath.string(), "CHANNEL", channelName);
             continue;
         }
         std::filesystem::path bus = std::filesystem::read_symlink(channelPath);
@@ -93,8 +92,8 @@
         std::filesystem::create_symlink(fp, link, ec);
         if (ec)
         {
-            std::cerr << "Failure creating symlink for " << fp << " to " << link
-                      << "\n";
+            lg2::error("Failure creating symlink for {PATH} to {LINK}", "PATH",
+                       fp.string(), "LINK", link.string());
         }
     }
 }
@@ -107,7 +106,7 @@
     std::ofstream deviceFile(deviceDestructor);
     if (!deviceFile.good())
     {
-        std::cerr << "Error writing " << deviceDestructor << "\n";
+        lg2::error("Error writing {PATH}", "PATH", deviceDestructor.string());
         return -1;
     }
     deviceFile << std::to_string(address);
@@ -124,7 +123,7 @@
     std::ofstream deviceFile(deviceConstructor);
     if (!deviceFile.good())
     {
-        std::cerr << "Error writing " << deviceConstructor << "\n";
+        lg2::error("Error writing {PATH}", "PATH", deviceConstructor.string());
         return -1;
     }
     deviceFile << parameters;
@@ -183,7 +182,7 @@
                  &io](const boost::system::error_code& ec) mutable {
                     if (ec)
                     {
-                        std::cerr << "Timer error: " << ec << "\n";
+                        lg2::error("Timer error: {ERR}", "ERR", ec.message());
                         return -2;
                     }
                     return buildDevice(name, busPath, parameters, bus, address,