Don't use click's newline echoing

click.echo does two write calls, which get flushed immediately. Using
this in multiprocessing might make output overlap. Using a single
write-call apparently resolves that issue, although i don't know why.

A proper solution would be to use locks, but e.g. multiprocessing's
logger doesn't seem have nearly as much flexibility as others. For now
it seems to be bugfree enough.
This commit is contained in:
Markus Unterwaditzer 2014-06-18 20:22:21 +02:00
parent a6e2f23bbc
commit 28b649dec9

View file

@ -32,7 +32,7 @@ class ColorFormatter(logging.Formatter):
class ClickStream(object):
def write(self, string):
click.echo(string.rstrip())
click.echo(string, nl=False)
stdout_handler = logging.StreamHandler(ClickStream())