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():