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