diff options
author | Ed Tanous <edtanous@google.com> | 2022-06-27 23:24:03 +0300 |
---|---|---|
committer | Ed Tanous <ed@tanous.net> | 2023-03-02 22:02:40 +0300 |
commit | 2feeb9d05739ee5de4f10aaa1527bc077c7a46e6 (patch) | |
tree | 5d7e1f478846033a9363fcf563eb704125fcecb1 | |
parent | 5ace29d2665cb70688edca5f9ca9e362958ce6b7 (diff) | |
download | bmcweb-2feeb9d05739ee5de4f10aaa1527bc077c7a46e6.tar.xz |
Remove excessive logging in managers
nlohmann::json::dump() calls are very wordy, have a lot of code to them,
and have some odd usages in exception safety (that are documented in
COMMON_ERRORS.md). Therefore, we should minimize how many places we
call it.
This file dumped the json values to the console for logging, which no
other handler does, and if we want, we have generic ways to do it.
readJson these days has quite a bit of built-in logging that should
cover all of these cases for debug.
Remove the logging, and make managers take on the style of the other
code around it.
Tested: Debug logging deletes only. Code compiles
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I019dd0549d65e4698e2cee863d9815ca7ddae5a2
-rw-r--r-- | redfish-core/lib/managers.hpp | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/redfish-core/lib/managers.hpp b/redfish-core/lib/managers.hpp index 01ec4e510d..2db8f86009 100644 --- a/redfish-core/lib/managers.hpp +++ b/redfish-core/lib/managers.hpp @@ -929,10 +929,6 @@ inline CreatePIDRet createPidInterface( "PositiveHysteresis", doubles["PositiveHysteresis"], "NegativeHysteresis", doubles["NegativeHysteresis"])) { - BMCWEB_LOG_ERROR - << "Illegal Property " - << it.value().dump(2, ' ', true, - nlohmann::json::error_handler_t::replace); return CreatePIDRet::fail; } if (zones) @@ -1026,10 +1022,6 @@ inline CreatePIDRet createPidInterface( failSafePercent, "MinThermalOutput", minThermalOutput)) { - BMCWEB_LOG_ERROR - << "Illegal Property " - << it.value().dump(2, ' ', true, - nlohmann::json::error_handler_t::replace); return CreatePIDRet::fail; } @@ -1040,11 +1032,6 @@ inline CreatePIDRet createPidInterface( if (!redfish::json_util::readJson(*chassisContainer, response->res, "@odata.id", chassisId)) { - BMCWEB_LOG_ERROR - << "Illegal Property " - << chassisContainer->dump( - 2, ' ', true, - nlohmann::json::error_handler_t::replace); return CreatePIDRet::fail; } @@ -1083,10 +1070,6 @@ inline CreatePIDRet createPidInterface( "NegativeHysteresis", negativeHysteresis, "Direction", direction)) { - BMCWEB_LOG_ERROR - << "Illegal Property " - << it.value().dump(2, ' ', true, - nlohmann::json::error_handler_t::replace); return CreatePIDRet::fail; } @@ -1121,11 +1104,6 @@ inline CreatePIDRet createPidInterface( if (!redfish::json_util::readJson(step, response->res, "Target", target, "Output", out)) { - BMCWEB_LOG_ERROR - << "Illegal Property " - << it.value().dump( - 2, ' ', true, - nlohmann::json::error_handler_t::replace); return CreatePIDRet::fail; } readings.emplace_back(target); @@ -1366,10 +1344,6 @@ struct SetPIDValues : std::enable_shared_from_this<SetPIDValues> "FanControllers", fanControllers, "FanZones", fanZones, "StepwiseControllers", stepwiseControllers, "Profile", profile)) { - BMCWEB_LOG_ERROR - << "Illegal Property " - << data.dump(2, ' ', true, - nlohmann::json::error_handler_t::replace); return; } configuration.emplace_back("PidControllers", std::move(pidControllers)); @@ -2227,10 +2201,6 @@ inline void requestRoutesManager(App& app) if (!redfish::json_util::readJson(*oem, asyncResp->res, "OpenBmc", openbmc)) { - BMCWEB_LOG_ERROR - << "Illegal Property " - << oem->dump(2, ' ', true, - nlohmann::json::error_handler_t::replace); return; } if (openbmc) @@ -2239,11 +2209,6 @@ inline void requestRoutesManager(App& app) if (!redfish::json_util::readJson(*openbmc, asyncResp->res, "Fan", fan)) { - BMCWEB_LOG_ERROR - << "Illegal Property " - << openbmc->dump( - 2, ' ', true, - nlohmann::json::error_handler_t::replace); return; } if (fan) |