Avoid unnecessary conversion of log_msg::payload to std::string.

This commit is contained in:
Alexander Zvyagin 2019-03-20 15:29:38 +01:00
parent af80db8c22
commit cc98e9850d
1 changed files with 3 additions and 2 deletions

View File

@ -59,8 +59,9 @@ protected:
{
if( sd_journal_print(
syslog_level(msg.level),
"%s",
fmt::to_string(msg.payload).c_str()
"%.*s",
static_cast<int>(msg.payload.size()),
msg.payload.data()
)
)
throw spdlog_ex("Failed writing to systemd");