1 #include <systemd/sd-journal.h> 2 3 #include <phosphor-logging/sdjournal.hpp> 4 5 #include <cstdarg> 6 7 namespace phosphor 8 { 9 namespace logging 10 { 11 12 int SdJournalHandler::journal_send_call(const char*) 13 { 14 return 0; 15 } 16 17 int SdJournalHandler::journal_send(const char* fmt, ...) 18 { 19 va_list args; 20 va_start(args, fmt); 21 22 int rc = ::sd_journal_send(fmt, args, NULL); 23 va_end(args); 24 25 return rc; 26 } 27 28 SdJournalHandler sdjournal_impl; 29 SdJournalHandler* sdjournal_ptr = &sdjournal_impl; 30 31 SdJournalHandler* SwapJouralHandler(SdJournalHandler* with) 32 { 33 SdJournalHandler* curr = sdjournal_ptr; 34 sdjournal_ptr = with; 35 return curr; 36 } 37 38 } // namespace logging 39 } // namespace phosphor 40