Skip to content

Commit

Permalink
HACK WARNING: wedge hostname into log messages so we can see where fa…
Browse files Browse the repository at this point in the history
…ilures come from
  • Loading branch information
sanga committed Apr 19, 2013
1 parent 3ec9c41 commit 225d48c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions locust/log.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import logging
import sys
import socket
hn = socket.gethostname()

def setup_logging(loglevel, logfile):
numeric_level = getattr(logging, loglevel.upper(), None)
Expand All @@ -20,14 +22,14 @@ class StdOutWrapper(object):
Wrapper for stdout
"""
def write(self, s):
stdout_logger.info(s.strip())
stdout_logger.info('{0}: {1}'.format(hn, s.strip()))

class StdErrWrapper(object):
"""
Wrapper for stderr
"""
def write(self, s):
stderr_logger.error(s.strip())
stderr_logger.error('{0}: {1}'.format(hn, s.strip()))

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

0 comments on commit 225d48c

Please sign in to comment.