logging: switch debug statements to lg2
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I6a5e8c3990b56fcbe9429b6d4bffe11aa399ebed
diff --git a/virtualSensor.cpp b/virtualSensor.cpp
index ce69291..9679b3f 100644
--- a/virtualSensor.cpp
+++ b/virtualSensor.cpp
@@ -6,7 +6,6 @@
#include <sdeventplus/event.hpp>
#include <fstream>
-#include <iostream>
static constexpr bool DEBUG = false;
static constexpr auto busName = "xyz.openbmc_project.VirtualSensor";
@@ -57,7 +56,7 @@
const auto& p1 = p.first;
const auto& p2 = p.second;
auto val = p2->getParamValue();
- std::cout << p1 << " = " << val << "\n";
+ debug("Parameter: {PARAM} = {VALUE}", "PARAM", p1, "VALUE", val);
}
}
@@ -439,7 +438,7 @@
if (DEBUG)
{
- std::cout << "Sensor value is " << val << "\n";
+ debug("Sensor {NAME} = {VALUE}", "NAME", this->name, "VALUE", val);
}
/* Check sensor thresholds and log required message */
@@ -811,7 +810,7 @@
// print values
if (DEBUG)
{
- std::cout << "Config json data:\n" << data << "\n\n";
+ debug("JSON: {JSON}", "JSON", data.dump());
}
/* Get virtual sensors config data */