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