meson: use phosphor-logging for debug statements
There is no need to individually patch each file to enable debug
logging.
All the different definitions of 'bool debug' are removed in favor of
using phosphor-logging.
Change-Id: Ia9a8ecfa4ea220f588d7cf2d291b14067e0391e7
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/src/perform_scan.cpp b/src/perform_scan.cpp
index e787360..91372e4 100644
--- a/src/perform_scan.cpp
+++ b/src/perform_scan.cpp
@@ -20,6 +20,7 @@
#include <boost/asio/steady_timer.hpp>
#include <boost/container/flat_map.hpp>
#include <boost/container/flat_set.hpp>
+#include <phosphor-logging/lg2.hpp>
#include <charconv>
@@ -38,8 +39,6 @@
constexpr const int32_t maxMapperDepth = 0;
-constexpr const bool debug = false;
-
struct DBusInterfaceInstance
{
std::string busName;
@@ -82,11 +81,6 @@
},
instance.busName, instance.path, "org.freedesktop.DBus.Properties",
"GetAll", instance.interface);
-
- if constexpr (debug)
- {
- std::cerr << __LINE__ << "\n";
- }
}
static void registerCallback(nlohmann::json& systemConfiguration,
@@ -201,11 +195,6 @@
"/xyz/openbmc_project/object_mapper",
"xyz.openbmc_project.ObjectMapper", "GetSubTree", "/", maxMapperDepth,
interfaces);
-
- if constexpr (debug)
- {
- std::cerr << __LINE__ << "\n";
- }
}
static std::string getRecordName(const DBusInterface& probe,
@@ -227,10 +216,7 @@
// hashes are hard to distinguish, use the non-hashed version if we want
// debug
- if constexpr (debug)
- {
- return probeName + device.dump();
- }
+ // return probeName + device.dump();
return std::to_string(std::hash<std::string>{}(probeName + device.dump()));
}
@@ -655,10 +641,6 @@
// about a dbus interface
findDbusObjects(std::move(dbusProbePointers),
std::move(dbusProbeInterfaces), shared_from_this());
- if constexpr (debug)
- {
- std::cerr << __LINE__ << "\n";
- }
}
PerformScan::~PerformScan()
@@ -671,19 +653,9 @@
nextScan->passedProbes = std::move(passedProbes);
nextScan->dbusProbeObjects = std::move(dbusProbeObjects);
nextScan->run();
-
- if constexpr (debug)
- {
- std::cerr << __LINE__ << "\n";
- }
}
else
{
_callback();
-
- if constexpr (debug)
- {
- std::cerr << __LINE__ << "\n";
- }
}
}