Page 1 of 1
how do I see qDebug statements on a Windows 11 installation
Posted: Sat Feb 01, 2025 11:08 pm
by mrhickman53
I have been developing scripts on a linux machine and am now trying to troubleshoot on a Windows 11 installation. I cannot figure out an incantation that permits me to see qDebug, Warnings or Errors.
Re: how do I see qDebug statements on a Windows 11 installation
Posted: Sun Feb 02, 2025 6:36 am
by CVH
mrhickman53 wrote: ↑Sat Feb 01, 2025 11:08 pm
I cannot figure out an incantation that permits me to see qDebug, Warnings or Errors.
That is restricted on a Win system, I other words: You can not ... Not in real time.
The presented solution is to
stream the output of QCAD to a log file and examine that afterwards.
The '
cat' command is reported as not functional.
It may work under PowerShell, otherwise use '
type'.
I have already problems with starting QCAD from a OS command line.
As said, not in real time and then debugging an interactive script is not really a solution via a log file.
Another option (for the time being) is to run QCAD in debugger mode.
The down side is that this mode is not really stable.
Another problem is that you cannot debug interactions with a Dialog because that is always modal.
Again it is Windows that doesn't allow this.
The debuger will be removed completely, see this topics:
QCAD Snapshots & Qt6 ;
QCAD + Qt6 vs debugger
I then frequently use
EAction.handleUserMessage [-Warning, -Info] ("MessageString") to display these things in the Command History in real time.
Regards,
CVH
Re: how do I see qDebug statements on a Windows 11 installation
Posted: Mon Feb 03, 2025 10:10 am
by andrew
You might want to install
cygwin (especially when coming from Linux) which can show the output when qcad.exe is run.
Re: how do I see qDebug statements on a Windows 11 installation
Posted: Wed Feb 05, 2025 6:34 am
by 333onlyhalfevil
I use Windows and generally run qcad using the command:
Code: Select all
qcad.exe 1>log.txt 2>&1 -rescan -enable-script-debugger
This will output your qdebug statement strings to a log.txt file that you can find in the same directory as your qcad.exe.
Re: how do I see qDebug statements on a Windows 11 installation
Posted: Wed Feb 05, 2025 6:39 am
by CVH
333onlyhalfevil wrote: ↑Wed Feb 05, 2025 6:34 am
This will output your qdebug ...
As explained in the 'stream' link but is this in real time?
For interactive scripts for example.
Regards,
CVH
Re: how do I see qDebug statements on a Windows 11 installation
Posted: Wed Feb 05, 2025 10:57 pm
by 333onlyhalfevil
CVH wrote: ↑Wed Feb 05, 2025 6:39 am
As explained in the 'stream' link
Yeah, I was trying to get the full command in here. I used the command in the link originally a long time ago and didn't know that you could have that command and also the debugger going at the same time. When scripting, I would mainly use the debugger, then when I needed qDebugs I'd run the command in the link. It's better to have them both going simultaneously.
CVH wrote: ↑Wed Feb 05, 2025 6:39 am
but is this in real time?
For interactive scripts for example.
It's not as good as just using a Linux terminal and having the ability to watch the qDebug statements popping up in real time. But using the Linux terminal requires (1) installing it and (2) figuring out how to use it which may or may not be worth it depending on what script is being worked on. I'm fairly sure, for interactive scripts, that you can just keep on opening the log.txt file as you click on stuff in the program and see what qDebug output lines have been added to the log.txt file since the last time you opened it up.
Re: how do I see qDebug statements on a Windows 11 installation
Posted: Thu Feb 06, 2025 8:36 am
by CVH
@333onlyhalfevil
Thanks for the info, for give it a try.
333onlyhalfevil wrote: ↑Wed Feb 05, 2025 10:57 pm
When scripting, I would mainly use the debugger
Scripting in JS, debugger mode (For the time being), NOT at all a stable environment.
Then
cygwin is out of the question, Win7
32bit and myself not acquainted with the Linux environment.
EAction.handleUserMessage [-Warning, -Info] ("MessageString") is then my only option outside the debugger mode.
For that my QCAD Command History/Line is docked at the right and displays several history lines.
I can then debug my code in real time, even with a modal dialog.
Regards,
CVH
Re: how do I see qDebug statements on a Windows 11 installation
Posted: Mon Mar 10, 2025 6:26 pm
by 333onlyhalfevil
Quick question. When you're on linux and run qcad using ./qcad -rescan -enable-script-debugger, is that supposed to automatically output the qdebug statements by default? or is there another command or settings that needs to be run in order to do it?
Re: how do I see qDebug statements on a Windows 11 installation
Posted: Tue Mar 11, 2025 5:39 am
by CVH
@333onlyhalfevil
333onlyhalfevil wrote: ↑Mon Mar 10, 2025 6:26 pm
When you're on linux and run qcad using ./qcad -rescan -enable-script-debugger, is that supposed to automatically output the qdebug statements by default?
A bit off-topic.
I think that you might get an answer when you start a new topic ... Linux related
Regards,
CVH
Re: how do I see qDebug statements on a Windows 11 installation
Posted: Wed Mar 12, 2025 6:13 am
by 333onlyhalfevil
CVH wrote: ↑Tue Mar 11, 2025 5:39 am
A bit off-topic.
I think that you might get an answer when you start a new topic ... Linux related
CVH
I suppose I could've added more words to make it on topic, however, it is indeed on topic because I'm on a Windows machine. I was trying to get a linux terminal set up within VS Code and I have it and it is working but the qDebug statements don't get printed out, hence the question. I can't try it on linux because I don't have a linux machine. Assuming I can get it to work, what I have will probably be a great option for windows users, assuming they use vs code.