New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Console output logging for Windows #2934
Comments
@lassoan I see on a Windows failed test case (http://slicer.cdash.org/test/16313164) what looks to be actual output which I've not seen on the Windows factory platform before. Was this issue intentionally fixed? Or is the output that I'm seeing some different? |
SlicerApp-real.exe is still built as a GUI application - without console output. The test you referred to uses a different executable (D:/D/P/Slicer-0-build/Slicer-build/bin/Release/qMRMLWidgetsCxxTests.exe), which is a console application and therefore CTest can capture the output of it. We fixed the launcher 1-2 years ago so that it can forward output of launched console applications to its own output. |
…ole output If SlicerApp-real.exe is built as a console application then it is possible to capture and redirect its output (to files, display, any other software), and test outputs also become visible on dashboard builds. If the launcher is still built as a Windows GUI application then no command console is displayed when Slicer is started. Added instructions (in Docs\developer_guide\debugging\overview.md) for accessing the console output when launcher is a Windows GUI application. re Slicer#2934
…ole output If SlicerApp-real.exe is built as a console application then it is possible to capture and redirect its output (to files, display, any other software), and test outputs also become visible on dashboard builds. If the launcher is still built as a Windows GUI application then no command console is displayed when Slicer is started. Added instructions (in Docs\developer_guide\debugging\overview.md) for accessing the console output when launcher is a Windows GUI application. re #2934
After 2d7cb88, the SlicerApp-real.exe application is a console application by default, so its output can be captured. To make AppLauncher (Slicer.exe) behave the same way as on linux, it could be updated to detect if a console is available (using AttachConsole) and if that's the case then write the child process output to the console using WriteConsoleOutput. This would make Slicer.exe act as a console application when started from a console, but would not create a console when Slicer.exe is started from GUI. |
I've fixed the issue (a wrong flag was used to decide if WIN32 build flag should be added). I'll test it some more and if everything works well, I'll push the fixed commit. |
…ole output (corrected) If SlicerApp-real.exe is built as a console application then it is possible to capture and redirect its output (to files, display, any other software), and test outputs also become visible on dashboard builds. If the launcher is still built as a Windows GUI application then no command console is displayed when Slicer is started. Added instructions (in Docs\developer_guide\debugging\overview.md) for accessing the console output when launcher is a Windows GUI application. This is a corrected version of a previous commit that was reverted because it contained an error (in SlicerMacroBuildApplication.cmake, the condition to set SLICERAPP_EXE_OPTIONS to WIN32 was based on Slicer_HAS_CONSOLE_LAUNCHER instead of Slicer_HAS_CONSOLE_IO_SUPPORT). re #2934
@lassoan Would you consider this issue to be complete now? |
The only limitation is that the default launcher on Windows is not a console application. Workarounds are described in the documentation and users can overwrite |
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
The text was updated successfully, but these errors were encountered: