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/configuration.cpp b/src/entity_manager/configuration.cpp
index 1e4ceac..b6ece2b 100644
--- a/src/entity_manager/configuration.cpp
+++ b/src/entity_manager/configuration.cpp
@@ -1,10 +1,10 @@
 #include "configuration.hpp"
 
 #include "perform_probe.hpp"
-#include "phosphor-logging/lg2.hpp"
 #include "utils.hpp"
 
 #include <nlohmann/json.hpp>
+#include <phosphor-logging/lg2.hpp>
 #include <valijson/adapters/nlohmann_json_adapter.hpp>
 #include <valijson/schema.hpp>
 #include <valijson/schema_parser.hpp>
@@ -12,7 +12,6 @@
 
 #include <filesystem>
 #include <fstream>
-#include <iostream>
 #include <string>
 #include <vector>
 
@@ -33,8 +32,8 @@
                                                hostConfigurationDirectory},
             R"(.*\.json)", jsonPaths))
     {
-        std::cerr << "Unable to find any configuration files in "
-                  << configurationDirectory << "\n";
+        lg2::error("Unable to find any configuration files in {DIR}", "DIR",
+                   configurationDirectory);
         return;
     }
 
@@ -42,8 +41,7 @@
         std::string(schemaDirectory) + "/" + globalSchema);
     if (!schemaStream.good())
     {
-        std::cerr
-            << "Cannot open schema file,  cannot validate JSON, exiting\n\n";
+        lg2::error("Cannot open schema file,  cannot validate JSON, exiting");
         std::exit(EXIT_FAILURE);
         return;
     }
@@ -51,8 +49,8 @@
         nlohmann::json::parse(schemaStream, nullptr, false, true);
     if (schema.is_discarded())
     {
-        std::cerr
-            << "Illegal schema file detected, cannot validate JSON, exiting\n";
+        lg2::error(
+            "Illegal schema file detected, cannot validate JSON, exiting");
         std::exit(EXIT_FAILURE);
         return;
     }
@@ -62,19 +60,19 @@
         std::ifstream jsonStream(jsonPath.c_str());
         if (!jsonStream.good())
         {
-            std::cerr << "unable to open " << jsonPath.string() << "\n";
+            lg2::error("unable to open {PATH}", "PATH", jsonPath.string());
             continue;
         }
         auto data = nlohmann::json::parse(jsonStream, nullptr, false, true);
         if (data.is_discarded())
         {
-            std::cerr << "syntax error in " << jsonPath.string() << "\n";
+            lg2::error("syntax error in {PATH}", "PATH", jsonPath.string());
             continue;
         }
 
         if (ENABLE_RUNTIME_VALIDATE_JSON && !validateJson(schema, data))
         {
-            std::cerr << "Error validating " << jsonPath.string() << "\n";
+            lg2::error("Error validating {PATH}", "PATH", jsonPath.string());
             continue;
         }
 
@@ -137,7 +135,8 @@
         auto findProbe = it->find("Probe");
         if (findProbe == it->end())
         {
-            std::cerr << "configuration file missing probe:\n " << *it << "\n";
+            lg2::error("configuration file missing probe: {PROBE}", "PROBE",
+                       *it);
             it++;
             continue;
         }
@@ -158,7 +157,7 @@
             const std::string* probe = probeJson.get_ptr<const std::string*>();
             if (probe == nullptr)
             {
-                std::cerr << "Probe statement wasn't a string, can't parse";
+                lg2::error("Probe statement wasn't a string, can't parse");
                 continue;
             }
             // Skip it if the probe cmd doesn't contain an interface.