lib: Add ot_journal_* helper macros
Rather than wrapping each instance of `sd_journal_*` with `HAVE_SYSTEMD`, let's just add some convenience macros that are just no-op if we're not compiling with systemd. Closes: #1841 Approved by: cgwalters
This commit is contained in:
1 parent
d69214ade3
commit
5464535205
4 files changed
+14
-16
No files matched your search
@@ -163,18 +163,16 @@ _ostree_fetcher_journal_failure (const char *remote_name,
|
||||
const char *url,
|
||||
const char *msg)
|
||||
{
|
||||
#ifdef HAVE_LIBSYSTEMD
|
||||
/* Sanity - we don't want to log this when doing local/file pulls */
|
||||
if (!remote_name)
|
||||
return;
|
||||
sd_journal_send ("MESSAGE=libostree HTTP error from remote %s for <%s>: %s",
|
||||
ot_journal_send ("MESSAGE=libostree HTTP error from remote %s for <%s>: %s",
|
||||
remote_name, url, msg,
|
||||
"MESSAGE_ID=" SD_ID128_FORMAT_STR, SD_ID128_FORMAT_VAL(OSTREE_HTTP_FAILURE_ID),
|
||||
"OSTREE_REMOTE=%s", remote_name,
|
||||
"OSTREE_URL=%s", url,
|
||||
"PRIORITY=%i", LOG_ERR,
|
||||
NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Check whether a particular operation should be retried. This is entirely
|
||||
|
||||
Reference in new issue
Block a user