All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zdenek Kabelac <zkabelac@sourceware.org>
To: lvm-devel@redhat.com
Subject: main - log: also build without systemd_journal_support
Date: Thu, 14 Oct 2021 21:37:11 +0000 (GMT)	[thread overview]
Message-ID: <20211014213711.EE1A73858433@sourceware.org> (raw)

Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=0bd5388b16e2a14285ecd91ebf9f5537b5b303cc
Commit:        0bd5388b16e2a14285ecd91ebf9f5537b5b303cc
Parent:        b73e1cd4b3edb5dabc631cca78f780012beb93fa
Author:        Zdenek Kabelac <zkabelac@redhat.com>
AuthorDate:    Thu Oct 14 20:50:01 2021 +0200
Committer:     Zdenek Kabelac <zkabelac@redhat.com>
CommitterDate: Thu Oct 14 23:34:11 2021 +0200

log: also build without systemd_journal_support

---
 lib/log/log.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/log/log.c b/lib/log/log.c
index f9568792f..7b4d537b3 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -25,7 +25,10 @@
 #include <syslog.h>
 #include <ctype.h>
 #include <time.h>
+
+#ifdef SYSTEMD_JOURNAL_SUPPORT
 #include <systemd/sd-journal.h>
+#endif
 
 static FILE *_log_file;
 static char _log_file_path[PATH_MAX];
@@ -622,6 +625,7 @@ static void _vprint_log(int level, const char *file, int line, int dm_errno_or_c
 
       log_it:
 
+#ifdef SYSTEMD_JOURNAL_SUPPORT
 	if (_log_journal) {
 		int to_journal = 0;
 
@@ -647,6 +651,7 @@ static void _vprint_log(int level, const char *file, int line, int dm_errno_or_c
 			va_end(ap);
 		}
 	}
+#endif
 
 	if (!logged_via_report && ((verbose_level() >= level) && !_log_suppress)) {
 		if (verbose_level() > _LOG_DEBUG) {
@@ -858,6 +863,7 @@ void log_set_report_object_name_and_id(const char *name, const char *id)
 
 void log_command(const char *cmd_line, const char *cmd_name, const char *cmd_id)
 {
+#ifdef SYSTEMD_JOURNAL_SUPPORT
 	if (_log_journal & LOG_JOURNAL_COMMAND) {
 
 		/*
@@ -875,6 +881,7 @@ void log_command(const char *cmd_line, const char *cmd_name, const char *cmd_id)
 				"PRIORITY=%i", LOG_INFO,
 				NULL);
 	}
+#endif
 }
 
 uint32_t log_journal_str_to_val(const char *str)



                 reply	other threads:[~2021-10-14 21:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211014213711.EE1A73858433@sourceware.org \
    --to=zkabelac@sourceware.org \
    --cc=lvm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.