Add phosphor-logging

This commit adds phosphor-logging (lg2) to eStorageD. It also adds
several logging statements.

Signed-off-by: John Edward Broadbent <jebr@google.com>
Change-Id: Ideb4f6033b94dd8b1384c79cd3a26ce89e7b2c4c
diff --git a/phosphor-logging.wrap b/phosphor-logging.wrap
new file mode 100644
index 0000000..a039fcf
--- /dev/null
+++ b/phosphor-logging.wrap
@@ -0,0 +1,3 @@
+[wrap-git]
+url = https://github.com/openbmc/phosphor-logging.git
+revision = HEAD
diff --git a/src/estoraged.cpp b/src/estoraged.cpp
index ae29bdd..8e49562 100644
--- a/src/estoraged.cpp
+++ b/src/estoraged.cpp
@@ -1,6 +1,8 @@
 
 #include "estoraged.hpp"
 
+#include <phosphor-logging/lg2.hpp>
+
 #include <iostream>
 #include <vector>
 
@@ -10,26 +12,36 @@
 void eStoraged::format(std::vector<uint8_t>)
 {
     std::cerr << "Formatting encrypted eMMC" << std::endl;
+    std::string msg = "OpenBMC.0.1.DriveFormat";
+    lg2::info("Starting format", "REDFISH_MESSAGE_ID", msg);
 }
 
 void eStoraged::erase(std::vector<uint8_t>, EraseMethod)
 {
     std::cerr << "Erasing encrypted eMMC" << std::endl;
+    std::string msg = "OpenBMC.0.1.DriveErase";
+    lg2::info("Starting erase", "REDFISH_MESSAGE_ID", msg);
 }
 
 void eStoraged::lock(std::vector<uint8_t>)
 {
     std::cerr << "Locking encrypted eMMC" << std::endl;
+    std::string msg = "OpenBMC.0.1.DriveLock";
+    lg2::info("Starting lock", "REDFISH_MESSAGE_ID", msg);
 }
 
 void eStoraged::unlock(std::vector<uint8_t>)
 {
     std::cerr << "Unlocking encrypted eMMC" << std::endl;
+    std::string msg = "OpenBMC.0.1.DriveUnlock";
+    lg2::info("Starting unlock", "REDFISH_MESSAGE_ID", msg);
 }
 
 void eStoraged::changePassword(std::vector<uint8_t>, std::vector<uint8_t>)
 {
     std::cerr << "Changing password for encrypted eMMC" << std::endl;
+    std::string msg = "OpenBMC.0.1.DrivePasswordChanged";
+    lg2::info("Starting change password", "REDFISH_MESSAGE_ID", msg);
 }
 
 } // namespace estoraged
diff --git a/src/main.cpp b/src/main.cpp
index 9fa9c7d..318ecda 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -3,6 +3,7 @@
 
 #include <unistd.h>
 
+#include <phosphor-logging/lg2.hpp>
 #include <sdbusplus/bus.hpp>
 
 #include <filesystem>
@@ -69,8 +70,9 @@
     /* Create an eStoraged object. */
     estoraged::eStoraged esObject{b, path.c_str(), physicalBlockDev,
                                   containerBlockDev};
-
-    std::cerr << "eStoraged has started" << std::endl;
+    std::string msg = "OpenBMC.1.0.ServiceStarted";
+    lg2::info("Storage management service is running", "REDFISH_MESSAGE_ID",
+              msg);
 
     while (true)
     {
diff --git a/src/meson.build b/src/meson.build
index 046ae47..958fa0a 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,6 +1,10 @@
 
 libeStoraged_deps = [
   dependency('sdbusplus'),
+  dependency('phosphor-logging',
+    fallback: ['phosphor-logging',
+               'phosphor_logging_dep'],
+    ),
   eStoraged_dbus,
 ]