Skip to content

Commit

Permalink
process: process log only capture stdout/stderr.
Browse files Browse the repository at this point in the history
Originally, all log of the Process class are captured in log_buffer. So when dump the process log, it includes LISA log. After the change, only stdout/stderr are included.
  • Loading branch information
squirrelsc authored and LiliDeng committed Dec 31, 2024
1 parent aca5f66 commit 8a5f0f6
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lisa/util/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,9 +214,6 @@ def __init__(

# add a string stream handler to the logger
self.log_buffer = io.StringIO()
self._log_handler = logging.StreamHandler(self.log_buffer)
msg_only_format = logging.Formatter(fmt="%(message)s", datefmt="")
add_handler(self._log_handler, self._log, msg_only_format)

@_retry_spawn
def start(
Expand Down Expand Up @@ -252,6 +249,11 @@ def start(
self._stdout_writer = LogWriter(logger=self.stdout_logger, level=stdout_level)
self._stderr_writer = LogWriter(logger=self.stderr_logger, level=stderr_level)

self._log_handler = logging.StreamHandler(self.log_buffer)
msg_only_format = logging.Formatter(fmt="%(message)s", datefmt="")
add_handler(self._log_handler, self.stdout_logger, msg_only_format)
add_handler(self._log_handler, self.stderr_logger, msg_only_format)

self._sudo = sudo
self._nohup = nohup

Expand Down

0 comments on commit 8a5f0f6

Please sign in to comment.