Skip to content

Commit

Permalink
remove uneeded wrappers for stdout (makes pdb work again)
Browse files Browse the repository at this point in the history
  • Loading branch information
whitmo committed Nov 19, 2012
1 parent 5e22bc9 commit b674cae
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions locust/log.py
@@ -1,5 +1,5 @@
import logging
import sys


def setup_logging(loglevel, logfile):
numeric_level = getattr(logging, loglevel.upper(), None)
Expand All @@ -8,27 +8,8 @@ def setup_logging(loglevel, logfile):

log_format = "[%(asctime)s] %(levelname)s/%(name)s: %(message)s"
logging.basicConfig(level=numeric_level, filename=logfile, format=log_format)

sys.stderr = StdErrWrapper()
sys.stdout = StdOutWrapper()

stdout_logger = logging.getLogger("stdout")
stderr_logger = logging.getLogger("stderr")

class StdOutWrapper(object):
"""
Wrapper for stdout
"""
def write(self, s):
stdout_logger.info(s.strip())

class StdErrWrapper(object):
"""
Wrapper for stderr
"""
def write(self, s):
stderr_logger.error(s.strip())


# set up logger for the statistics tables
console_logger = logging.getLogger("console_logger")
# create console handler
Expand Down

0 comments on commit b674cae

Please sign in to comment.