aboutgitcodebugslistschat
path: root/log.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2024-06-05 10:42:42 +1000
committerStefano Brivio <sbrivio@redhat.com>2024-06-05 21:14:09 +0200
commitb3aeb004eae0d168815d8ced8b3888e83e644cde (patch)
treede3234d930bc0073337333255bda311a7d8eb1c9 /log.c
parent7cb2088835784e101f7305445126b85b9c93a759 (diff)
downloadpasst-b3aeb004eae0d168815d8ced8b3888e83e644cde.tar
passt-b3aeb004eae0d168815d8ced8b3888e83e644cde.tar.gz
passt-b3aeb004eae0d168815d8ced8b3888e83e644cde.tar.bz2
passt-b3aeb004eae0d168815d8ced8b3888e83e644cde.tar.lz
passt-b3aeb004eae0d168815d8ced8b3888e83e644cde.tar.xz
passt-b3aeb004eae0d168815d8ced8b3888e83e644cde.tar.zst
passt-b3aeb004eae0d168815d8ced8b3888e83e644cde.zip
log: Remove log_to_stdout option
Now that we've simplified how usage() works, nothing ever sets the log_to_stdout flag. Eliminate it. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'log.c')
-rw-r--r--log.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/log.c b/log.c
index e3630c3..aaf2beb 100644
--- a/log.c
+++ b/log.c
@@ -46,18 +46,16 @@ static char log_header[BUFSIZ]; /* File header, written back on cuts */
static time_t log_start; /* Start timestamp */
int log_trace; /* --trace mode enabled */
-int log_to_stdout; /* Print to stdout instead of stderr */
void vlogmsg(int pri, const char *format, va_list ap)
{
bool debug_print = (log_mask & LOG_MASK(LOG_DEBUG)) && log_file == -1;
bool early_print = LOG_PRI(log_mask) == LOG_EARLY;
- FILE *out = log_to_stdout ? stdout : stderr;
struct timespec tp;
if (debug_print) {
clock_gettime(CLOCK_REALTIME, &tp);
- fprintf(out, "%lli.%04lli: ",
+ fprintf(stderr, "%lli.%04lli: ",
(long long int)tp.tv_sec - log_start,
(long long int)tp.tv_nsec / (100L * 1000));
}
@@ -75,9 +73,9 @@ void vlogmsg(int pri, const char *format, va_list ap)
}
if (debug_print || (early_print && !(log_opt & LOG_PERROR))) {
- (void)vfprintf(out, format, ap);
+ (void)vfprintf(stderr, format, ap);
if (format[strlen(format)] != '\n')
- fprintf(out, "\n");
+ fprintf(stderr, "\n");
}
}