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