Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Andrew Geissler | 6a0ef6f | 2020-04-06 15:06:31 -0500 | [diff] [blame] | 3 | #include "elog_block.hpp" |
Adriana Kobylak | df995fa | 2017-01-08 15:14:02 -0600 | [diff] [blame] | 4 | #include "elog_entry.hpp" |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 5 | #include "xyz/openbmc_project/Collection/DeleteAll/server.hpp" |
Matt Spinler | 3fb83b3 | 2019-07-26 11:22:44 -0500 | [diff] [blame] | 6 | #include "xyz/openbmc_project/Logging/Create/server.hpp" |
| 7 | #include "xyz/openbmc_project/Logging/Entry/server.hpp" |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 8 | #include "xyz/openbmc_project/Logging/Internal/Manager/server.hpp" |
| 9 | |
| 10 | #include <list> |
| 11 | #include <phosphor-logging/log.hpp> |
| 12 | #include <sdbusplus/bus.hpp> |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 13 | |
| 14 | namespace phosphor |
| 15 | { |
| 16 | namespace logging |
| 17 | { |
Adriana Kobylak | d722b3a | 2017-02-28 12:10:44 -0600 | [diff] [blame] | 18 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 19 | extern const std::map<std::string, std::vector<std::string>> g_errMetaMap; |
| 20 | extern const std::map<std::string, level> g_errLevelMap; |
Adriana Kobylak | d722b3a | 2017-02-28 12:10:44 -0600 | [diff] [blame] | 21 | |
Matt Spinler | 3fb83b3 | 2019-07-26 11:22:44 -0500 | [diff] [blame] | 22 | using CreateIface = sdbusplus::xyz::openbmc_project::Logging::server::Create; |
| 23 | using DeleteAllIface = |
| 24 | sdbusplus::xyz::openbmc_project::Collection::server::DeleteAll; |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 25 | |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 26 | namespace details |
| 27 | { |
Matt Spinler | 3fb83b3 | 2019-07-26 11:22:44 -0500 | [diff] [blame] | 28 | template <typename... T> |
| 29 | using ServerObject = typename sdbusplus::server::object::object<T...>; |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 30 | |
| 31 | using ManagerIface = |
| 32 | sdbusplus::xyz::openbmc_project::Logging::Internal::server::Manager; |
| 33 | |
| 34 | } // namespace details |
| 35 | |
Matt Spinler | c64b712 | 2020-03-26 10:55:01 -0500 | [diff] [blame] | 36 | constexpr size_t ffdcFormatPos = 0; |
| 37 | constexpr size_t ffdcSubtypePos = 1; |
| 38 | constexpr size_t ffdcVersionPos = 2; |
| 39 | constexpr size_t ffdcFDPos = 3; |
| 40 | |
| 41 | using FFDCEntry = std::tuple<CreateIface::FFDCFormat, uint8_t, uint8_t, |
| 42 | sdbusplus::message::unix_fd>; |
| 43 | |
| 44 | using FFDCEntries = std::vector<FFDCEntry>; |
| 45 | |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 46 | namespace internal |
| 47 | { |
| 48 | |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 49 | /** @class Manager |
| 50 | * @brief OpenBMC logging manager implementation. |
| 51 | * @details A concrete implementation for the |
| 52 | * xyz.openbmc_project.Logging.Internal.Manager DBus API. |
| 53 | */ |
Adriana Kobylak | f477fe2 | 2017-01-06 11:56:41 -0600 | [diff] [blame] | 54 | class Manager : public details::ServerObject<details::ManagerIface> |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 55 | { |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 56 | public: |
| 57 | Manager() = delete; |
| 58 | Manager(const Manager&) = delete; |
| 59 | Manager& operator=(const Manager&) = delete; |
| 60 | Manager(Manager&&) = delete; |
| 61 | Manager& operator=(Manager&&) = delete; |
| 62 | virtual ~Manager() = default; |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 63 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 64 | /** @brief Constructor to put object onto bus at a dbus path. |
| 65 | * @param[in] bus - Bus to attach to. |
| 66 | * @param[in] path - Path to attach at. |
| 67 | */ |
| 68 | Manager(sdbusplus::bus::bus& bus, const char* objPath) : |
| 69 | details::ServerObject<details::ManagerIface>(bus, objPath), busLog(bus), |
| 70 | entryId(0), fwVersion(readFWVersion()){}; |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 71 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 72 | /* |
| 73 | * @fn commit() |
| 74 | * @brief sd_bus Commit method implementation callback. |
| 75 | * @details Create an error/event log based on transaction id and |
| 76 | * error message. |
| 77 | * @param[in] transactionId - Unique identifier of the journal entries |
| 78 | * to be committed. |
| 79 | * @param[in] errMsg - The error exception message associated with the |
| 80 | * error log to be committed. |
| 81 | */ |
| 82 | void commit(uint64_t transactionId, std::string errMsg) override; |
Adriana Kobylak | df995fa | 2017-01-08 15:14:02 -0600 | [diff] [blame] | 83 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 84 | /* |
| 85 | * @fn commit() |
| 86 | * @brief sd_bus CommitWithLvl method implementation callback. |
| 87 | * @details Create an error/event log based on transaction id and |
| 88 | * error message. |
| 89 | * @param[in] transactionId - Unique identifier of the journal entries |
| 90 | * to be committed. |
| 91 | * @param[in] errMsg - The error exception message associated with the |
| 92 | * error log to be committed. |
| 93 | * @param[in] errLvl - level of the error |
| 94 | */ |
| 95 | void commitWithLvl(uint64_t transactionId, std::string errMsg, |
| 96 | uint32_t errLvl) override; |
Adriana Kobylak | df995fa | 2017-01-08 15:14:02 -0600 | [diff] [blame] | 97 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 98 | /** @brief Erase specified entry d-bus object |
| 99 | * |
| 100 | * @param[in] entryId - unique identifier of the entry |
| 101 | */ |
| 102 | void erase(uint32_t entryId); |
Deepak Kodihalli | 99a8549 | 2017-03-31 06:01:57 -0500 | [diff] [blame] | 103 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 104 | /** @brief Construct error d-bus objects from their persisted |
| 105 | * representations. |
| 106 | */ |
| 107 | void restore(); |
Deepak Kodihalli | 72654f1 | 2017-06-12 04:33:29 -0500 | [diff] [blame] | 108 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 109 | /** @brief Erase all error log entries |
| 110 | * |
| 111 | */ |
| 112 | void eraseAll() |
| 113 | { |
| 114 | auto iter = entries.begin(); |
| 115 | while (iter != entries.end()) |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 116 | { |
Patrick Venture | 3443896 | 2018-10-30 13:17:37 -0700 | [diff] [blame] | 117 | auto e = iter->first; |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 118 | ++iter; |
Patrick Venture | 3443896 | 2018-10-30 13:17:37 -0700 | [diff] [blame] | 119 | erase(e); |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 120 | } |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 121 | } |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 122 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 123 | /** @brief Returns the count of high severity errors |
| 124 | * |
| 125 | * @return int - count of real errors |
| 126 | */ |
| 127 | int getRealErrSize(); |
Nagaraju Goruganti | 477b731 | 2018-06-25 23:28:58 -0500 | [diff] [blame] | 128 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 129 | /** @brief Returns the count of Info errors |
| 130 | * |
| 131 | * @return int - count of info errors |
| 132 | */ |
| 133 | int getInfoErrSize(); |
Nagaraju Goruganti | 477b731 | 2018-06-25 23:28:58 -0500 | [diff] [blame] | 134 | |
Andrew Geissler | 6a0ef6f | 2020-04-06 15:06:31 -0500 | [diff] [blame] | 135 | /** @brief Returns the number of blocking errors |
| 136 | * |
| 137 | * @return int - count of blocking errors |
| 138 | */ |
| 139 | int getBlockingErrSize() |
| 140 | { |
| 141 | return blockingErrors.size(); |
| 142 | } |
| 143 | |
Matt Spinler | 8ebfd31 | 2019-06-03 12:43:59 -0500 | [diff] [blame] | 144 | sdbusplus::bus::bus& getBus() |
| 145 | { |
| 146 | return busLog; |
| 147 | } |
| 148 | |
Matt Spinler | 3fb83b3 | 2019-07-26 11:22:44 -0500 | [diff] [blame] | 149 | /** @brief Creates an event log |
| 150 | * |
| 151 | * This is an alternative to the _commit() API. It doesn't use |
| 152 | * the journal to look up event log metadata like _commit does. |
| 153 | * |
| 154 | * @param[in] errMsg - The error exception message associated with the |
| 155 | * error log to be committed. |
| 156 | * @param[in] severity - level of the error |
| 157 | * @param[in] additionalData - The AdditionalData property for the error |
| 158 | */ |
| 159 | void create( |
| 160 | const std::string& message, |
| 161 | sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level severity, |
| 162 | const std::map<std::string, std::string>& additionalData); |
| 163 | |
Matt Spinler | c64b712 | 2020-03-26 10:55:01 -0500 | [diff] [blame] | 164 | /** @brief Creates an event log, and accepts FFDC files |
| 165 | * |
| 166 | * This is the same as create(), but also takes an FFDC argument. |
| 167 | * |
| 168 | * The FFDC argument is a vector of tuples that allows one to pass in file |
| 169 | * descriptors for files that contain FFDC (First Failure Data Capture). |
| 170 | * These will be passed to any event logging extensions. |
| 171 | * |
| 172 | * @param[in] errMsg - The error exception message associated with the |
| 173 | * error log to be committed. |
| 174 | * @param[in] severity - level of the error |
| 175 | * @param[in] additionalData - The AdditionalData property for the error |
| 176 | * @param[in] ffdc - A vector of FFDC file info |
| 177 | */ |
| 178 | void createWithFFDC( |
| 179 | const std::string& message, |
| 180 | sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level severity, |
| 181 | const std::map<std::string, std::string>& additionalData, |
| 182 | const FFDCEntries& ffdc); |
| 183 | |
Andrew Geissler | c0c500e | 2020-03-26 11:08:56 -0500 | [diff] [blame] | 184 | /** @brief Common wrapper for creating an Entry object |
| 185 | * |
| 186 | * @return true if quiesce on error setting is enabled, false otherwise |
| 187 | */ |
| 188 | bool isQuiesceOnErrorEnabled(); |
| 189 | |
| 190 | /** @brief Check if error has callout and if so, block boot |
| 191 | * |
| 192 | * @param[in] entry - The error to check for callouts |
| 193 | */ |
| 194 | void checkQuiesceOnError(const Entry& entry); |
| 195 | |
Andrew Geissler | e4960ee | 2020-03-30 14:31:52 -0500 | [diff] [blame] | 196 | /** @brief Check if inventory callout present in input entry |
| 197 | * |
| 198 | * @param[in] entry - The error to check for callouts |
| 199 | * |
| 200 | * @return true if inventory item in associations, false otherwise |
| 201 | */ |
| 202 | bool isCalloutPresent(const Entry& entry); |
| 203 | |
Andrew Geissler | ced6e2a | 2020-04-07 16:15:29 -0500 | [diff] [blame^] | 204 | /** @brief Check (and remove) entry being erased from blocking errors |
| 205 | * |
| 206 | * @param[in] entryId - The entry that is being erased |
| 207 | */ |
| 208 | void checkAndRemoveBlockingError(uint32_t entryId); |
| 209 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 210 | private: |
| 211 | /* |
| 212 | * @fn _commit() |
| 213 | * @brief commit() helper |
| 214 | * @param[in] transactionId - Unique identifier of the journal entries |
| 215 | * to be committed. |
| 216 | * @param[in] errMsg - The error exception message associated with the |
| 217 | * error log to be committed. |
| 218 | * @param[in] errLvl - level of the error |
| 219 | */ |
| 220 | void _commit(uint64_t transactionId, std::string&& errMsg, |
| 221 | Entry::Level errLvl); |
Deepak Kodihalli | 6fd9dc4 | 2018-04-03 02:08:42 -0500 | [diff] [blame] | 222 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 223 | /** @brief Call metadata handler(s), if any. Handlers may create |
| 224 | * associations. |
| 225 | * @param[in] errorName - name of the error |
| 226 | * @param[in] additionalData - list of metadata (in key=value format) |
| 227 | * @param[out] objects - list of error's association objects |
| 228 | */ |
| 229 | void processMetadata(const std::string& errorName, |
| 230 | const std::vector<std::string>& additionalData, |
| 231 | AssociationList& objects) const; |
Deepak Kodihalli | a87c157 | 2017-02-28 07:40:34 -0600 | [diff] [blame] | 232 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 233 | /** @brief Synchronize unwritten journal messages to disk. |
| 234 | * @details This is the same implementation as the systemd command |
| 235 | * "journalctl --sync". |
| 236 | */ |
| 237 | void journalSync(); |
Adriana Kobylak | 5f4247f | 2018-03-15 10:27:05 -0500 | [diff] [blame] | 238 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 239 | /** @brief Reads the BMC code level |
| 240 | * |
| 241 | * @return std::string - the version string |
| 242 | */ |
| 243 | static std::string readFWVersion(); |
Matt Spinler | 1275bd1 | 2018-05-01 15:13:53 -0500 | [diff] [blame] | 244 | |
Matt Spinler | 99c2b40 | 2019-05-23 14:29:16 -0500 | [diff] [blame] | 245 | /** @brief Call any create() functions provided by any extensions. |
| 246 | * This is called right after an event log is created to allow |
| 247 | * extensions to create their own log based on this one. |
| 248 | * |
| 249 | * @param[in] entry - the new event log entry |
Matt Spinler | c64b712 | 2020-03-26 10:55:01 -0500 | [diff] [blame] | 250 | * @param[in] ffdc - A vector of FFDC file info |
Matt Spinler | 99c2b40 | 2019-05-23 14:29:16 -0500 | [diff] [blame] | 251 | */ |
Matt Spinler | c64b712 | 2020-03-26 10:55:01 -0500 | [diff] [blame] | 252 | void doExtensionLogCreate(const Entry& entry, const FFDCEntries& ffdc); |
Matt Spinler | 99c2b40 | 2019-05-23 14:29:16 -0500 | [diff] [blame] | 253 | |
Matt Spinler | b60e755 | 2019-07-24 15:28:08 -0500 | [diff] [blame] | 254 | /** @brief Common wrapper for creating an Entry object |
| 255 | * |
| 256 | * @param[in] errMsg - The error exception message associated with the |
| 257 | * error log to be committed. |
| 258 | * @param[in] errLvl - level of the error |
| 259 | * @param[in] additionalData - The AdditionalData property for the error |
Matt Spinler | c64b712 | 2020-03-26 10:55:01 -0500 | [diff] [blame] | 260 | * @param[in] ffdc - A vector of FFDC file info. Defaults to an empty |
| 261 | * vector. |
Matt Spinler | b60e755 | 2019-07-24 15:28:08 -0500 | [diff] [blame] | 262 | */ |
| 263 | void createEntry(std::string errMsg, Entry::Level errLvl, |
Matt Spinler | c64b712 | 2020-03-26 10:55:01 -0500 | [diff] [blame] | 264 | std::vector<std::string> additionalData, |
| 265 | const FFDCEntries& ffdc = FFDCEntries{}); |
Matt Spinler | b60e755 | 2019-07-24 15:28:08 -0500 | [diff] [blame] | 266 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 267 | /** @brief Persistent sdbusplus DBus bus connection. */ |
| 268 | sdbusplus::bus::bus& busLog; |
Adriana Kobylak | df995fa | 2017-01-08 15:14:02 -0600 | [diff] [blame] | 269 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 270 | /** @brief Persistent map of Entry dbus objects and their ID */ |
| 271 | std::map<uint32_t, std::unique_ptr<Entry>> entries; |
Adriana Kobylak | 4ea7f31 | 2017-01-10 12:52:34 -0600 | [diff] [blame] | 272 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 273 | /** @brief List of error ids for high severity errors */ |
| 274 | std::list<uint32_t> realErrors; |
Nagaraju Goruganti | e4b0b77 | 2017-11-30 02:12:45 -0600 | [diff] [blame] | 275 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 276 | /** @brief List of error ids for Info(and below) severity */ |
| 277 | std::list<uint32_t> infoErrors; |
Nagaraju Goruganti | f8a5a79 | 2017-10-13 08:09:52 -0500 | [diff] [blame] | 278 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 279 | /** @brief Id of last error log entry */ |
| 280 | uint32_t entryId; |
Matt Spinler | 1275bd1 | 2018-05-01 15:13:53 -0500 | [diff] [blame] | 281 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 282 | /** @brief The BMC firmware version */ |
| 283 | const std::string fwVersion; |
Andrew Geissler | 6a0ef6f | 2020-04-06 15:06:31 -0500 | [diff] [blame] | 284 | |
| 285 | /** @brief Array of blocking errors */ |
| 286 | std::vector<std::unique_ptr<Block>> blockingErrors; |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 287 | }; |
| 288 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 289 | } // namespace internal |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 290 | |
| 291 | /** @class Manager |
Matt Spinler | 3fb83b3 | 2019-07-26 11:22:44 -0500 | [diff] [blame] | 292 | * @brief Implementation for deleting all error log entries and |
| 293 | * creating new logs. |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 294 | * @details A concrete implementation for the |
Matt Spinler | 3fb83b3 | 2019-07-26 11:22:44 -0500 | [diff] [blame] | 295 | * xyz.openbmc_project.Collection.DeleteAll and |
| 296 | * xyz.openbmc_project.Logging.Create interfaces. |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 297 | */ |
Matt Spinler | 3fb83b3 | 2019-07-26 11:22:44 -0500 | [diff] [blame] | 298 | class Manager : public details::ServerObject<DeleteAllIface, CreateIface> |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 299 | { |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 300 | public: |
| 301 | Manager() = delete; |
| 302 | Manager(const Manager&) = delete; |
| 303 | Manager& operator=(const Manager&) = delete; |
| 304 | Manager(Manager&&) = delete; |
| 305 | Manager& operator=(Manager&&) = delete; |
| 306 | virtual ~Manager() = default; |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 307 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 308 | /** @brief Constructor to put object onto bus at a dbus path. |
| 309 | * Defer signal registration (pass true for deferSignal to the |
| 310 | * base class) until after the properties are set. |
| 311 | * @param[in] bus - Bus to attach to. |
| 312 | * @param[in] path - Path to attach at. |
| 313 | * @param[in] manager - Reference to internal manager object. |
| 314 | */ |
| 315 | Manager(sdbusplus::bus::bus& bus, const std::string& path, |
| 316 | internal::Manager& manager) : |
Matt Spinler | 3fb83b3 | 2019-07-26 11:22:44 -0500 | [diff] [blame] | 317 | details::ServerObject<DeleteAllIface, CreateIface>(bus, path.c_str(), |
| 318 | true), |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 319 | manager(manager){}; |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 320 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 321 | /** @brief Delete all d-bus objects. |
| 322 | */ |
| 323 | void deleteAll() |
| 324 | { |
| 325 | manager.eraseAll(); |
| 326 | } |
| 327 | |
Matt Spinler | 3fb83b3 | 2019-07-26 11:22:44 -0500 | [diff] [blame] | 328 | /** @brief D-Bus method call implementation to create an event log. |
| 329 | * |
| 330 | * @param[in] errMsg - The error exception message associated with the |
| 331 | * error log to be committed. |
| 332 | * @param[in] severity - Level of the error |
| 333 | * @param[in] additionalData - The AdditionalData property for the error |
| 334 | */ |
| 335 | void create( |
| 336 | std::string message, |
| 337 | sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level severity, |
| 338 | std::map<std::string, std::string> additionalData) override |
| 339 | { |
| 340 | manager.create(message, severity, additionalData); |
| 341 | } |
| 342 | |
Matt Spinler | c64b712 | 2020-03-26 10:55:01 -0500 | [diff] [blame] | 343 | /** @brief D-Bus method call implementation to create an event log with FFDC |
| 344 | * |
| 345 | * The same as create(), but takes an extra FFDC argument. |
| 346 | * |
| 347 | * @param[in] errMsg - The error exception message associated with the |
| 348 | * error log to be committed. |
| 349 | * @param[in] severity - Level of the error |
| 350 | * @param[in] additionalData - The AdditionalData property for the error |
| 351 | * @param[in] ffdc - A vector of FFDC file info |
| 352 | */ |
Matt Spinler | fcbaf3e | 2020-03-23 09:22:45 -0500 | [diff] [blame] | 353 | void createWithFFDCFiles( |
| 354 | std::string message, |
| 355 | sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level severity, |
| 356 | std::map<std::string, std::string> additionalData, |
| 357 | std::vector<std::tuple<CreateIface::FFDCFormat, uint8_t, uint8_t, |
| 358 | sdbusplus::message::unix_fd>> |
| 359 | ffdc) override |
| 360 | { |
Matt Spinler | c64b712 | 2020-03-26 10:55:01 -0500 | [diff] [blame] | 361 | manager.createWithFFDC(message, severity, additionalData, ffdc); |
Matt Spinler | fcbaf3e | 2020-03-23 09:22:45 -0500 | [diff] [blame] | 362 | } |
| 363 | |
Patrick Venture | f18bf83 | 2018-10-26 18:14:00 -0700 | [diff] [blame] | 364 | private: |
| 365 | /** @brief This is a reference to manager object */ |
| 366 | internal::Manager& manager; |
Nagaraju Goruganti | 05aae8b | 2017-08-30 07:56:12 -0500 | [diff] [blame] | 367 | }; |
| 368 | |
Adriana Kobylak | 8f7941e | 2016-11-14 14:46:23 -0600 | [diff] [blame] | 369 | } // namespace logging |
| 370 | } // namespace phosphor |