@@ -267,15 +267,15 @@ def configure(loglevel=logging.INFO, verbose=False):
|
||||
|
||||
logger = logging.getLogger()
|
||||
|
||||
outstream = sys.stderr
|
||||
outstream = sys.stdout
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
# Our custom output stream processor knows how to deal with select ANSI
|
||||
# color escape sequences
|
||||
outstream = WindowsOutputStream()
|
||||
outstream = WindowsOutputStream(outstream)
|
||||
formatter = ANSIColorFormatter(verbose)
|
||||
|
||||
elif sys.stderr.isatty():
|
||||
elif outstream.isatty():
|
||||
# terminal logging with ANSI color
|
||||
formatter = ANSIColorFormatter(verbose)
|
||||
|
||||
|
||||
@@ -97,9 +97,9 @@ processes = Setting(required=True, validator=int, default=-1)
|
||||
# ends up adding overhead and isn't worth it.
|
||||
memcached_host = Setting(required=False, validator=str, default=None)
|
||||
|
||||
if platform.system() == 'Windows' or not sys.stderr.isatty():
|
||||
if platform.system() == 'Windows' or not sys.stdout.isatty():
|
||||
obs = LoggingObserver()
|
||||
else:
|
||||
obs = ProgressBarObserver()
|
||||
obs = ProgressBarObserver(fd=sys.stdout)
|
||||
|
||||
observer = Setting(required=True, validator=validateObserver, default=obs)
|
||||
|
||||
Reference in New Issue
Block a user