Changes between Initial Version and Version 1 of Ticket #1123, comment 4
- Timestamp:
- Jul 18, 2018 5:38:37 AM (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #1123, comment 4
initial v1 1 from JIRA: 2 3 ---- 4 '''''Torin Cooper-Bennun, 11 Jul 2018 13:59''''' 1 '''JIRA: ''Torin Cooper-Bennun, 11 Jul 2018 13:59''''' 5 2 6 3 Multiple issues surfaced here: 7 4 8 1. The `XStream` class completely redirects stdout and stderr output to its `messageWritten` signal'''(caused logs to disappear from console)'''9 1. In multiple places, the logging level was variously set to `WARNING` or `INFO`'''(caused logs to disappear from log file)'''10 1. The log configuration (in `logging.ini`) was being totally overwritten in `sas.qtgui.Utilities.SasviewLogger`, whereas it was only necessary to add a `QtHandler` to the existing configuration'''(may have caused logs to disappear from log file)'''5 1. The `XStream` class completely redirects stdout and stderr output to its `messageWritten` signal '''(caused logs to disappear from console)''' 6 1. In multiple places, the logging level was variously set to `WARNING` or `INFO` '''(caused logs to disappear from log file)''' 7 1. The log configuration (in `logging.ini`) was being totally overwritten in `sas.qtgui.Utilities.SasviewLogger`, whereas it was only necessary to add a `QtHandler` to the existing configuration '''(may have caused logs to disappear from log file)''' 11 8 12 The solution for 1 is to have `XStream` instances save the original text stream object (e.g. `sys.stdout`) and both write to it, and emit the`messageWritten`signal.9 The solution for 1 is to have `XStream` instances save the original text stream object (e.g. `sys.stdout`) and both write to it, and emit the `messageWritten`signal. 13 10 14 For 2 and 3, all log configuration should happen in `sas.logger_config` using the `logger.ini` file as a basis, with the exception of the `QtHandler` set-up; if `QtHandler` is set up at that stage, then signals are not emitted (probably because Qt has not been initialised yet). Therefore `QtHandler` set-up should remain in`sas.qtgui.Utilities.SasviewLogger`.11 For 2 and 3, all log configuration should happen in `sas.logger_config` using the `logger.ini` file as a basis, with the exception of the `QtHandler` set-up; if `QtHandler` is set up at that stage, then signals are not emitted (probably because Qt has not been initialised yet). Therefore `QtHandler` set-up should remain in `sas.qtgui.Utilities.SasviewLogger`. 15 12 16 The changes made so far are in branch ESS_GUI_iss957 in the following commit: 13 The changes made so far are in branch ESS_GUI_iss957 in the following commit: https://github.com/SasView/sasview/commit/5dba493865ca4dde5a4220a06e044a33a56ae211 17 14 15 ---- 16 '''Summary of email conversation with Piotr:''' 17 18 The behaviour of the stdout/stderr redirection is highly platform-dependent, and the Python `logging` module seems to interfere. Currently no stdout/stderr redirection occurs any more, but logs themselves are directed to the QT GUI through a custom logging handler. 19 20 ---- 18 21 A pull request has been opened: https://github.com/SasView/sasview/pull/158