Browse Source

Hide output if the application is non interactive

Andrea Luzzardi 17 years ago
parent
commit
4adfc09f0c
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      src/log.c

+ 3
- 0
src/log.c View File

@ -16,6 +16,7 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <unistd.h>
#include <syslog.h> #include <syslog.h>
#include <stdarg.h> #include <stdarg.h>
#include "conf.h" #include "conf.h"
@ -32,6 +33,8 @@ static void pusb_log_syslog(int level, const char *format, va_list ap)
static void pusb_log_output(int level, const char *format, va_list ap) static void pusb_log_output(int level, const char *format, va_list ap)
{ {
if (!isatty(fileno(stdin)))
return ;
if (pusb_opts && !pusb_opts->quiet) if (pusb_opts && !pusb_opts->quiet)
{ {
if (pusb_opts && pusb_opts->color_log) if (pusb_opts && pusb_opts->color_log)


Loading…
Cancel
Save