Skip to content

Commit 380428e

Browse files
committed
emsure we only log the test message
Signed-off-by: Jose Borreguero <borreguero@gmail.com>
1 parent 4f6153b commit 380428e

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Framework/PythonInterface/mantid/utils/logging.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,14 @@ def log_to_python(level=None, pattern=None) -> None:
7272
to forward all potentially relevant messages to Python and let *Python's* logger
7373
filter out undesired messages. Possible values: 'trace', 'debug',
7474
'information', 'notice', 'warning', 'error', 'critical', 'fatal'.
75-
@param str pattern: A logging pattern to format messages before forwarding them (example: %t)
75+
@param str pattern: A logging pattern to format messages before forwarding them (example: '[%s] %t')
7676
See https://github.com/pocoproject/poco/wiki/Poco::Util::Application-Logging-Configuration#logging-format-placeholders
7777
"""
7878
config = ConfigService.Instance()
7979
if level is not None:
8080
config["logging.loggers.root.level"] = level
8181
if pattern is not None:
8282
config["logging.channels.consoleChannel.formatter"] = "f1"
83-
# Output only the message text and let Python take care of formatting.
8483
config["logging.formatters.f1.class"] = "PatternFormatter"
8584
config["logging.formatters.f1.pattern"] = pattern
8685
# Important: Do this one last because it triggers re-init of logging system!

Framework/PythonInterface/test/python/mantid/utils/loggingTest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def test_log_to_python(self):
5151
py_logger.addHandler(handler)
5252

5353
with temporary_config():
54-
log_to_python()
54+
log_to_python(level="%t")
5555
logger.information("[[info]]")
5656
logger.warning("[[warning]]")
5757
logger.error("[[error]]")

0 commit comments

Comments
 (0)