summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xutil/ec3po/console.py5
-rw-r--r--util/ec3po/interpreter.py5
2 files changed, 8 insertions, 2 deletions
diff --git a/util/ec3po/console.py b/util/ec3po/console.py
index 66ed9ea53b..4244061b5c 100755
--- a/util/ec3po/console.py
+++ b/util/ec3po/console.py
@@ -13,6 +13,7 @@ session-persistent command history.
from __future__ import print_function
import argparse
+import copy
import ctypes
import binascii
# pylint: disable=cros-logging-import
@@ -148,7 +149,9 @@ class Console(object):
unidirectional pipe attached to the intepreter. EC debug messages use
this pipe.
"""
- logger = logging.getLogger('EC3PO.Console')
+ # Copy the logger, so modifying one ec3po logger level will not modify the
+ # loglevel for every ec3po console.
+ logger = copy.copy(logging.getLogger('EC3PO.Console'))
self.logger = interpreter.LoggerAdapter(logger, {'pty': user_pty})
self.master_pty = master_pty
self.user_pty = user_pty
diff --git a/util/ec3po/interpreter.py b/util/ec3po/interpreter.py
index 86272f6646..305dc81812 100644
--- a/util/ec3po/interpreter.py
+++ b/util/ec3po/interpreter.py
@@ -16,6 +16,7 @@ from __future__ import print_function
import binascii
# pylint: disable=cros-logging-import
+import copy
import logging
import os
import Queue
@@ -91,7 +92,9 @@ class Interpreter(object):
log_level: An optional integer representing the numeric value of the log
level. By default, the log level will be logging.INFO (20).
"""
- logger = logging.getLogger('EC3PO.Interpreter')
+ # Copy the logger, so modifying one ec3po logger level will not modify the
+ # loglevel for every ec3po interpreter.
+ logger = copy.copy(logging.getLogger('EC3PO.Interpreter'))
self.logger = LoggerAdapter(logger, {'pty': ec_uart_pty})
self.ec_uart_pty = open(ec_uart_pty, 'a+')
self.ec_uart_pty_name = ec_uart_pty