Skip to content

Commit 115ade0

Browse files
authored
Re-add logging posibility in repl/server. (#886)
1 parent 7cf9e68 commit 115ade0

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

pymodbus/repl/server/main.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
else:
2020
CANCELLED_ERROR = asyncio.CancelledError # pylint: disable=invalid-name
2121

22-
_logger = logging.getLogger(__name__)
23-
2422

2523
@click.group("ReactiveModbusServer")
2624
@click.option("--host", default="localhost", help="Host address")
@@ -36,11 +34,12 @@ def server(ctx, host, web_port, broadcast_support, repl, verbose):
3634
"""Run server code."""
3735
FORMAT = ('%(asctime)-15s %(threadName)-15s' # pylint: disable=invalid-name
3836
' %(levelname)-8s %(module)-15s:%(lineno)-8s %(message)s')
37+
pymodbus_logger = logging.getLogger("pymodbus")
3938
logging.basicConfig(format=FORMAT) # NOSONAR
4039
if verbose:
41-
_logger.setLevel(logging.DEBUG)
40+
pymodbus_logger.setLevel(logging.DEBUG)
4241
else:
43-
_logger.setLevel(logging.ERROR)
42+
pymodbus_logger.setLevel(logging.ERROR)
4443

4544
ctx.obj = {"repl": repl, "host": host, "web_port": web_port,
4645
"broadcast": broadcast_support}

0 commit comments

Comments
 (0)