trigger_actions.cpp (b7b7e1b603fd9df56a72547c8048d182a001d647) | trigger_actions.cpp (cff70c14ef8cadb7fffd0cd41e06b972fa240e56) |
---|---|
1#include "trigger_actions.hpp" 2 3#include "messages/update_report_ind.hpp" 4#include "types/trigger_types.hpp" 5#include "utils/clock.hpp" 6#include "utils/messanger.hpp" | 1#include "trigger_actions.hpp" 2 3#include "messages/update_report_ind.hpp" 4#include "types/trigger_types.hpp" 5#include "utils/clock.hpp" 6#include "utils/messanger.hpp" |
7#include "utils/to_short_enum.hpp" |
|
7 8#include <phosphor-logging/log.hpp> 9 10#include <ctime> 11#include <iomanip> 12#include <sstream> 13 14namespace action --- 33 unchanged lines hidden (view full) --- 48 const std::string& sensorName, 49 const Milliseconds timestamp, 50 const TriggerValue triggerValue) 51{ 52 double value = std::get<double>(triggerValue); 53 std::string thresholdName = ::numeric::typeToString(type); 54 auto direction = getDirection(value, threshold); 55 | 8 9#include <phosphor-logging/log.hpp> 10 11#include <ctime> 12#include <iomanip> 13#include <sstream> 14 15namespace action --- 33 unchanged lines hidden (view full) --- 49 const std::string& sensorName, 50 const Milliseconds timestamp, 51 const TriggerValue triggerValue) 52{ 53 double value = std::get<double>(triggerValue); 54 std::string thresholdName = ::numeric::typeToString(type); 55 auto direction = getDirection(value, threshold); 56 |
56 std::string msg = "Numeric threshold '" + thresholdName + "' of trigger '" + 57 triggerId + "' is crossed on sensor " + sensorName + 58 ", recorded value: " + std::to_string(value) + 59 ", crossing direction: " + direction + 60 ", timestamp: " + timestampToString(timestamp); | 57 std::string msg = 58 "Numeric threshold '" + std::string(utils::toShortEnum(thresholdName)) + 59 "' of trigger '" + triggerId + "' is crossed on sensor " + sensorName + 60 ", recorded value: " + std::to_string(value) + 61 ", crossing direction: " + std::string(utils::toShortEnum(direction)) + 62 ", timestamp: " + timestampToString(timestamp); |
61 62 phosphor::logging::log<phosphor::logging::level::INFO>(msg.c_str()); 63} 64 65const char* LogToRedfishEventLog::getRedfishMessageId() const 66{ 67 switch (type) 68 { --- 71 unchanged lines hidden (view full) --- 140void LogToJournal::commit(const std::string& triggerId, 141 const ThresholdName thresholdNameIn, 142 const std::string& sensorName, 143 const Milliseconds timestamp, 144 const TriggerValue triggerValue) 145{ 146 auto value = std::get<std::string>(triggerValue); 147 | 63 64 phosphor::logging::log<phosphor::logging::level::INFO>(msg.c_str()); 65} 66 67const char* LogToRedfishEventLog::getRedfishMessageId() const 68{ 69 switch (type) 70 { --- 71 unchanged lines hidden (view full) --- 142void LogToJournal::commit(const std::string& triggerId, 143 const ThresholdName thresholdNameIn, 144 const std::string& sensorName, 145 const Milliseconds timestamp, 146 const TriggerValue triggerValue) 147{ 148 auto value = std::get<std::string>(triggerValue); 149 |
148 std::string msg = "Discrete condition '" + thresholdNameIn->get() + 149 "' of trigger '" + triggerId + "' is met on sensor " + 150 sensorName + ", recorded value: " + value + 151 ", severity: " + ::discrete::severityToString(severity) + 152 ", timestamp: " + timestampToString(timestamp); | 150 std::string msg = 151 "Discrete condition '" + thresholdNameIn->get() + "' of trigger '" + 152 triggerId + "' is met on sensor " + sensorName + 153 ", recorded value: " + value + ", severity: " + 154 std::string(utils::toShortEnum(utils::enumToString(severity))) + 155 ", timestamp: " + timestampToString(timestamp); |
153 154 phosphor::logging::log<phosphor::logging::level::INFO>(msg.c_str()); 155} 156 157const char* LogToRedfishEventLog::getRedfishMessageId() const 158{ 159 switch (severity) 160 { --- 146 unchanged lines hidden --- | 156 157 phosphor::logging::log<phosphor::logging::level::INFO>(msg.c_str()); 158} 159 160const char* LogToRedfishEventLog::getRedfishMessageId() const 161{ 162 switch (severity) 163 { --- 146 unchanged lines hidden --- |