debug() in windows (3.1 rc2)

For AI and campaign script related discussions and questions
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

debug() in windows (3.1 rc2)

Post by Duha »

Hi,

I try to launch game from cmd (windows console) but it runs in separate process (like launching in linux terminal with &)
How can I get debug prints?

3.1 rc2
Win7-64
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: debug() in windows (3.1 rc2)

Post by NoQ »

Hmm. Do you have anything interesting in logs/WZlog-*.txt?
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: debug() in windows (3.1 rc2)

Post by Duha »

NoQ wrote:Hmm. Do you have anything interesting in logs/WZlog-*.txt?
No, just standard logs with "info" entries.
http://addons.wz2100.net/ developer
User avatar
vexed
Inactive
Inactive
Posts: 2538
Joined: 27 Jul 2010, 02:07

Re: debug() in windows (3.1 rc2)

Post by vexed »

All debug() statements will show in the log, if and only if it is turned on.
Info, Fatal, and something else is on by default, the rest you need to run the game like --debug=all (for everything), --debug=3d (for debug calls that use LOG_3D) and so on.

If you want to reroute to the console, then I think you can use 1>* 2>* or something along those lines...
/facepalm ...Grinch stole Warzone🙈🙉🙊 contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: debug() in windows (3.1 rc2)

Post by NoQ »

The talk is about the JS debug() function.
User avatar
vexed
Inactive
Inactive
Posts: 2538
Joined: 27 Jul 2010, 02:07

Re: debug() in windows (3.1 rc2)

Post by vexed »

NoQ wrote:The talk is about the JS debug() function.
:hmm: :oops:
:stressed:

Shouldn't post late at night.
/facepalm ...Grinch stole Warzone🙈🙉🙊 contra principia negantem non est disputandum
Super busy, don't expect a timely reply back.
User avatar
NoQ
Special
Special
Posts: 6226
Joined: 24 Dec 2009, 11:35
Location: /var/zone

Re: debug() in windows (3.1 rc2)

Post by NoQ »

js_debug calls qWarning to print the text.
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: debug() in windows (3.1 rc2)

Post by Duha »

NoQ wrote:js_debug calls qWarning to print the text.
void qWarning ( const char * msg, ... )
Calls the message handler with the warning message msg. If no message handler has been installed, the message is printed to stderr. Under Windows, the message is sent to the debugger. This function does nothing if QT_NO_WARNING_OUTPUT was defined during compilation; it exits if the environment variable QT_FATAL_WARNINGS is defined.
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: debug() in windows (3.1 rc2)

Post by Duha »

Duha wrote:
NoQ wrote:js_debug calls qWarning to print the text.
void qWarning ( const char * msg, ... )
Calls the message handler with the warning message msg. If no message handler has been installed, the message is printed to stderr. Under Windows, the message is sent to the debugger. This function does nothing if QT_NO_WARNING_OUTPUT was defined during compilation; it exits if the environment variable QT_FATAL_WARNINGS is defined.
I solve it via external tool:
viewtopic.php?f=35&t=10080
http://addons.wz2100.net/ developer
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: debug() in windows (3.1 rc2)

Post by Per »

So should I change javascript debug() to use the C debug() as a quick fix? Then it will show up in the log files, at least.
User avatar
Duha
Trained
Trained
Posts: 287
Joined: 25 Mar 2012, 20:05
Location: SPb, Russia

Re: debug() in windows (3.1 rc2)

Post by Duha »

Per wrote:So should I change javascript debug() to use the C debug() as a quick fix? Then it will show up in the log files, at least.
If you plan solid fix later, don`t spend you time for quick fix. I have work around this, it is not trouble for me anymore. But changes can break someone workflow.
http://addons.wz2100.net/ developer
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: debug() in windows (3.1 rc2)

Post by aubergine »

Why not just have it do both - what it currently does and also put the debug in to the log file as well?
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Per
Warzone 2100 Team Member
Warzone 2100 Team Member
Posts: 3780
Joined: 03 Aug 2006, 19:39

Re: debug() in windows (3.1 rc2)

Post by Per »

aubergine wrote:Why not just have it do both - what it currently does and also put the debug in to the log file as well?
Because on Linux that would print double of every debug line...
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: debug() in windows (3.1 rc2)

Post by aubergine »

Could it do just one if it detects that it's running on linux? (I assume there is some way to detect which platform the game is being run on or compiled for?)
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
User avatar
aubergine
Professional
Professional
Posts: 3459
Joined: 10 Oct 2010, 00:58
Contact:

Re: debug() in windows (3.1 rc2)

Post by aubergine »

Where does debug output currently go on Mac OS X? It's not in the logs (as far as I can tell) and not sure how to see the stderr for an app launched via an icon in apps folder :s
"Dedicated to discovering Warzone artefacts, and sharing them freely for the benefit of the community."
-- https://warzone.atlassian.net/wiki/display/GO
Post Reply