Skip to content
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

Closed
slicerbot opened this issue Mar 12, 2020 · 7 comments
Closed

Console output logging for Windows #2934

slicerbot opened this issue Mar 12, 2020 · 7 comments
Assignees
Milestone

Comments

@slicerbot
Copy link
Collaborator

This issue was created automatically from an original Mantis Issue. Further discussion may take place here.

@slicerbot slicerbot added this to the Slicer 4.11.0 milestone Mar 12, 2020
@lassoan lassoan self-assigned this Mar 26, 2020
@jamesobutler
Copy link
Contributor

@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?

@lassoan
Copy link
Contributor

lassoan commented Jan 16, 2021

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.

lassoan added a commit to lassoan/Slicer that referenced this issue Sep 9, 2021
…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
lassoan added a commit that referenced this issue Sep 10, 2021
…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
@lassoan
Copy link
Contributor

lassoan commented Sep 10, 2021

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.

@lassoan lassoan modified the milestones: Slicer 4.13.0, Backlog Sep 10, 2021
@jamesobutler
Copy link
Contributor

2d7cb88 was reverted in 0db2e6e due to Slicer startup issues.

@lassoan
Copy link
Contributor

lassoan commented Sep 12, 2021

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.

lassoan added a commit that referenced this issue Sep 13, 2021
…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
@jamesobutler
Copy link
Contributor

@lassoan Would you consider this issue to be complete now?

@lassoan
Copy link
Contributor

lassoan commented Jan 2, 2023

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 Slicer.exe bin/PythonSlicer.exe (which is a console launcher), so I think we can close this issue.

@lassoan lassoan closed this as completed Jan 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants