forked from TrueCloudLab/s3-tests
Swap stdout/stderr -- debug messages then go to stderr, and yaml data to stdout
This commit is contained in:
parent
ce6c57841a
commit
0297d61e40
3 changed files with 8 additions and 1 deletions
|
@ -4,6 +4,7 @@ import itertools
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
import string
|
import string
|
||||||
|
import sys
|
||||||
import yaml
|
import yaml
|
||||||
|
|
||||||
s3 = bunch.Bunch()
|
s3 = bunch.Bunch()
|
||||||
|
@ -13,6 +14,10 @@ prefix = ''
|
||||||
# For those scripts that use a context, these are pretty univerally needed.
|
# For those scripts that use a context, these are pretty univerally needed.
|
||||||
context = bunch.Bunch(
|
context = bunch.Bunch(
|
||||||
bucket = None,
|
bucket = None,
|
||||||
|
|
||||||
|
# Save stdout/stderr in case they get fudged with.
|
||||||
|
real_stdout = sys.stdout,
|
||||||
|
real_stderr = sys.stderr,
|
||||||
)
|
)
|
||||||
|
|
||||||
bucket_counter = itertools.count(1)
|
bucket_counter = itertools.count(1)
|
||||||
|
|
|
@ -93,7 +93,7 @@ class ResultsLogger(gevent.Greenlet):
|
||||||
""" A quick little greenlet to always run and dump results. """
|
""" A quick little greenlet to always run and dump results. """
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
gevent.Greenlet.__init__(self)
|
gevent.Greenlet.__init__(self)
|
||||||
self.outfile = sys.stderr
|
self.outfile = context.real_stdout
|
||||||
|
|
||||||
def _run(self):
|
def _run(self):
|
||||||
while True:
|
while True:
|
||||||
|
|
|
@ -10,6 +10,7 @@ import random
|
||||||
import realistic
|
import realistic
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
import sys
|
||||||
|
|
||||||
import common
|
import common
|
||||||
from common import context, config
|
from common import context, config
|
||||||
|
@ -86,6 +87,7 @@ def _main():
|
||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
sys.stdout = sys.stderr # Original steam already saved by common
|
||||||
common.setup()
|
common.setup()
|
||||||
setup()
|
setup()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue