1 #include "elog_entry.hpp" 2 #include "extensions.hpp" 3 #include "manager.hpp" 4 5 namespace openpower 6 { 7 namespace pels 8 { 9 10 using namespace phosphor::logging; 11 12 std::unique_ptr<Manager> manager; 13 14 DISABLE_LOG_ENTRY_CAPS(); 15 16 void pelStartup(internal::Manager& logManager) 17 { 18 manager = std::make_unique<Manager>(logManager); 19 } 20 21 REGISTER_EXTENSION_FUNCTION(pelStartup); 22 23 void pelCreate(const std::string& message, uint32_t id, uint64_t timestamp, 24 Entry::Level severity, const AdditionalDataArg& additionalData, 25 const AssociationEndpointsArg& assocs) 26 { 27 manager->create(message, id, timestamp, severity, additionalData, assocs); 28 } 29 30 REGISTER_EXTENSION_FUNCTION(pelCreate); 31 32 void pelDelete(uint32_t id) 33 { 34 return manager->erase(id); 35 } 36 37 REGISTER_EXTENSION_FUNCTION(pelDelete); 38 39 void pelDeleteProhibited(uint32_t id, bool& prohibited) 40 { 41 prohibited = manager->isDeleteProhibited(id); 42 } 43 44 REGISTER_EXTENSION_FUNCTION(pelDeleteProhibited); 45 46 } // namespace pels 47 } // namespace openpower 48