From cb41ff2922b8a555c01d52e1038ac26360253c15 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Wed, 22 Oct 2014 23:27:57 -0500 Subject: shared/log: add log_trace as compile-time optional debugging Repetetive messages can be annoying when running with SYSTEMD_LOG_LEVEL=debug, but they are sometimes very useful when debugging problems. Add log_trace which is like log_debug but becomes a noop unless LOG_TRACE is defined during compilation. This makes it easy to enable very verbose logging for a subset of programs when compiling from source. --- src/journal-remote/journal-remote-parse.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/journal-remote/journal-remote-parse.c') diff --git a/src/journal-remote/journal-remote-parse.c b/src/journal-remote/journal-remote-parse.c index 224e8f140b..7dd8878ca6 100644 --- a/src/journal-remote/journal-remote-parse.c +++ b/src/journal-remote/journal-remote-parse.c @@ -330,7 +330,7 @@ int process_data(RemoteSource *source) { assert(line[n-1] == '\n'); if (n == 1) { - log_debug("Received empty line, event is ready"); + log_trace("Received empty line, event is ready"); return 1; } @@ -350,7 +350,7 @@ int process_data(RemoteSource *source) { else /* replace \n with = */ line[n-1] = '='; - log_debug("Received: %.*s", (int) n, line); + log_trace("Received: %.*s", (int) n, line); r = iovw_put(&source->iovw, line, n); if (r < 0) { @@ -438,7 +438,7 @@ int process_source(RemoteSource *source, bool compress, bool seal) { return r; /* We have a full event */ - log_debug("Received a full event from source@%p fd:%d (%s)", + log_trace("Received a full event from source@%p fd:%d (%s)", source, source->fd, source->name); if (!source->iovw.count) { -- cgit v1.2.3-54-g00ecf