mirror of
https://github.com/clearml/wexpect-venv
synced 2025-01-31 02:46:59 +00:00
[FIX] fix duplicated logging #28
This commit is contained in:
parent
fff4281702
commit
08e2ffa109
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
test_01_installed/*
|
||||
|
||||
# Byte-compiled / optimized / DLL files
|
||||
__pycache__/
|
||||
*.py[cod]
|
||||
@ -42,7 +44,7 @@ pip-delete-this-directory.txt
|
||||
# Unit test / coverage reports
|
||||
htmlcov/
|
||||
.tox/
|
||||
.coverage
|
||||
.coverage*
|
||||
.cache
|
||||
nosetests.xml
|
||||
coverage.xml
|
||||
|
@ -42,8 +42,6 @@ default_port = 4321
|
||||
#
|
||||
logger = logging.getLogger('wexpect')
|
||||
|
||||
init_logger(logger)
|
||||
|
||||
|
||||
class ConsoleReaderBase:
|
||||
"""Consol class (aka. client-side python class) for the child.
|
||||
|
@ -65,8 +65,6 @@ from .wexpect_util import SIGNAL_CHARS
|
||||
|
||||
logger = logging.getLogger('wexpect')
|
||||
|
||||
init_logger(logger)
|
||||
|
||||
|
||||
def run(command, timeout=-1, withexitstatus=False, events=None, extra_args=None, logfile=None,
|
||||
cwd=None, env=None, **kwargs):
|
||||
|
@ -36,7 +36,9 @@ def spam(self, message, *args, **kws):
|
||||
logging.Logger.spam = spam
|
||||
|
||||
|
||||
def init_logger(logger):
|
||||
def init_logger(logger=None):
|
||||
if logger is None:
|
||||
logger = logging.getLogger('wexpect')
|
||||
try:
|
||||
logger_level = os.environ['WEXPECT_LOGGER_LEVEL']
|
||||
try:
|
||||
@ -160,3 +162,5 @@ class EOF(ExceptionPexpect):
|
||||
|
||||
class TIMEOUT(ExceptionPexpect):
|
||||
"""Raised when a read time exceeds the timeout. """
|
||||
|
||||
init_logger()
|
||||
|
Loading…
Reference in New Issue
Block a user