diff --git a/misc/notes/search-notes.py b/misc/notes/search-notes.py index 9d24e6b..795a779 100755 --- a/misc/notes/search-notes.py +++ b/misc/notes/search-notes.py @@ -107,9 +107,9 @@ def __init__(self): def init_logging(self): """Initialize the logging subsystem.""" self.logger = logging.getLogger('search-notes') - self.logger.addHandler(logging.StreamHandler(sys.stderr)) - if os.isatty(0): - self.logger.setLevel(logging.INFO) + self.logger.setLevel(logging.INFO) + if all(map(os.isatty, (0, 1, 2))): + self.logger.addHandler(logging.StreamHandler(sys.stderr)) def parse_args(self): """Parse the command line arguments."""