From dc401d6c3a8c1721492504fa3cd0cf1c5de06382 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Wed, 23 Apr 2014 10:18:45 -0400 Subject: [PATCH] Fix mistake in trying to log stdout and stderr and clean up formatting --- confluent/log.py | 3 ++- confluent/main.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/confluent/log.py b/confluent/log.py index 7875ab1c..b45a190b 100644 --- a/confluent/log.py +++ b/confluent/log.py @@ -170,7 +170,8 @@ class Logger(object): else: textrecord = textdate + data + ']' else: - textrecord = textdate + data + '\n' + if not textrecord.endswith('\n'): + textrecord = textdate + data + '\n' self.textfile.write(textrecord) fcntl.flock(self.textfile, fcntl.LOCK_UN) fcntl.flock(self.binfile, fcntl.LOCK_EX) diff --git a/confluent/main.py b/confluent/main.py index f7fd705e..adf0e6d4 100644 --- a/confluent/main.py +++ b/confluent/main.py @@ -54,8 +54,8 @@ def _daemonize(): os.open(os.devnull, os.O_RDWR) os.dup2(0, 1) os.dup2(0, 2) - sys.stdout = log.logger('stdout') - sys.stderr = log.logger('stderr') + sys.stdout = log.Logger('stdout') + sys.stderr = log.Logger('stderr') def _updatepidfile():