mirror of
https://github.com/gabime/spdlog.git
synced 2025-01-15 17:27:57 +00:00
Compare commits
3 Commits
2b8afb38b7
...
6f6cadf31d
Author | SHA1 | Date | |
---|---|---|---|
|
6f6cadf31d | ||
|
17513a6dce | ||
|
a44560ddb6 |
@ -8,6 +8,9 @@
|
||||
#include "spdlog/details/synchronous_factory.h"
|
||||
|
||||
#include <array>
|
||||
#ifndef SD_JOURNAL_SUPPRESS_LOCATION
|
||||
#define SD_JOURNAL_SUPPRESS_LOCATION
|
||||
#endif
|
||||
#include <systemd/sd-journal.h>
|
||||
|
||||
namespace spdlog {
|
||||
@ -58,12 +61,14 @@ protected:
|
||||
{
|
||||
// Note: function call inside '()' to avoid macro expansion
|
||||
err = (sd_journal_send)(
|
||||
"MESSAGE=%.*s", static_cast<int>(length), msg.payload.data(), "PRIORITY=%d", syslog_level(msg.level), nullptr);
|
||||
"MESSAGE=%.*s", static_cast<int>(length), msg.payload.data(), "PRIORITY=%d", syslog_level(msg.level),
|
||||
"SYSLOG_IDENTIFIER=%.*s", static_cast<int>(msg.logger_name.size()), msg.logger_name.data(), nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
err = (sd_journal_send)("MESSAGE=%.*s", static_cast<int>(length), msg.payload.data(), "PRIORITY=%d", syslog_level(msg.level),
|
||||
"SOURCE_FILE=%s", msg.source.filename, "SOURCE_LINE=%d", msg.source.line, "SOURCE_FUNC=%s", msg.source.funcname, nullptr);
|
||||
"SYSLOG_IDENTIFIER=%.*s", static_cast<int>(msg.logger_name.size()), msg.logger_name.data(),
|
||||
"CODE_FILE=%s", msg.source.filename, "CODE_LINE=%d", msg.source.line, "CODE_FUNC=%s", msg.source.funcname, nullptr);
|
||||
}
|
||||
|
||||
if (err)
|
||||
|
Loading…
Reference in New Issue
Block a user