Updated Python Debug Console [v1.5]

For test results, bug reports, announcements of new builds etc.

Moderators: winston, another_commander, Getafix

User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Updated Python Debug Console [v1.5]

Post by Kaks »

Here's the last version of the debug console for windows & posix systems. It'll be available via berlios/sourceforge, but you can grab it from the following location too:

Oolite Javascript Console v1.5

This zip file contains the 'compiled' windows version of the console to use with windows, and the original python code. The original code can be used in all computer platforms with python 2.5/2.6 installed. If running the python code directly, you'll need to install the twisted package first.


Version 1.5 - This last version includes a number of minor improvements, the most notable of which are: the integrated command history buffer is properly saved & restored when closing and restarting the console, the console now responds properly to show-console-on-error (& show-console-on-log, & show-console-on-warning) directives (can be changed - permanently in trunk - via console.settings['show-console-on-error'] = true/false; defaults to on-log = false, on-warning = on-error = true) and the :clr macro now clears the console main console window, as per the integrated mac console - the [clear] button on the console is now used to clear the command line - useful for copy & paste badly gone wrong!
One last thing: the way the integrated mac console handles colour is different enough to the way the external console does it that the :fgColor, :bgColor, :rmFgColor, and :rmBgColor macros are likely to remain non-functional in windows & linux for the foreseeable future.

Version 1.4.4 - in technicolor - now allows various colours to be set via the .cfg file - not all of them possibly the most pleasant chromatic experience. The colour format is similar to the way web colours are set for the web(hexadecimal 6 figure numbers prefixed by #). Please look at the readme for further details.

Version 1.4 now allows the .exe to listen to any port (1 to 65535) by just adding one line to the .cfg file. To listen to port 8564 the setting is

Code: Select all

Port = 8564
This way you can have multiple copies of the console (in different directories), each connected to a different copy of Oolite! :)

Version 1.3 is a bit more flexible still - default size is back to 500x380, like the original windows debug console - however it now automagically restores itself to the size & position you used it last. And it can be set not to restore last size & position too, if you so wish.

Version 1.2 should be easier to use now, thanks to its integrated command history buffer! ;)
Last edited by Kaks on Sat Mar 31, 2012 5:38 pm, edited 9 times in total.
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Updated Debug Console

Post by Svengali »

Cool! Thanks Kaks .-)
User avatar
Thargoid
Thargoid
Thargoid
Posts: 5528
Joined: Thu Jun 12, 2008 6:55 pm

Re: Updated Debug Console

Post by Thargoid »

Indeed, much smoother now. Saves a lot of C&P, muchas gracias.
another_commander
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 6682
Joined: Wed Feb 28, 2007 7:54 am

Re: Updated Debug Console

Post by another_commander »

Kaks, I would like to release version 1.2 on Berlios but there is something that annoys me a bit in this version: the window is generated too small to be useful and I have to drag it to a bigger size every time the console is launched. Would it be a good idea adding at around line 220 of DebugConsole.py the line root.geometry("500x380") to make it generate a window with size similar to that of version 1.0?

If we can sort this little detail out, I would be more than happy to get it up for release. If people are happy as it is we can go ahead anyway, but personally I'd prefer a somewhat more workable startup window.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: Updated Debug Console

Post by Kaks »

And we could always add an auto generated JSConsoleSettings.plist to make it automagically remember the last size and position it was set to, I suppose... :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: Updated Debug Console

Post by Kaks »

Ok, done them changes, the new download is available from the same place as before! :)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Updated Debug Console

Post by Switeck »

In the middle of my Latest.log, I spotted this line:
02:44:59.437 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'unknown error.' (outStream status: 4, inStream status: 3)."

Is this a problem?
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: Updated Debug Console

Post by Kaks »

It's probably a problem, but only if you want to have a connected debug console! :lol:


All it's telling us is that for some unknown reason the initial connection didn't go as expected.

If I had to hazard a wild guess, it might be that you have a firewall and that it spotted a changed OoDebugConsole.exe.
If that's the case, the one missing packet could have happened while it was letting you know that a program might potentially have been modified by some malware and you were telling it that everything was fine.


Please do let us know if Oolite & the console keep failing to connect for no apparent reason on a random basis, though! ;)
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Re: Updated Debug Console

Post by Commander McLane »

Practically all log excerpts posted here from Windows computers contain that line, which simply means that the majority of Oolite PC users don't have a debug console installed (it's not necessary for normal gameplay).

Maybe you don't have either?
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Updated Debug Console

Post by Switeck »

After the trouble I went to downloading and running Debug Console v1.3, I would presume I have debug console installed and running when I ran Oolite after that.

Kaks explanation seems plausible, as I did overwrite and earlier version of Debug Console's .exe file since I used the same folder for it. Windows firewall is up and running, so it probably intercepted and blocked some TCP packets. But I never got a message from the firewall about allowing/blocking Debug Console, at least not since I first ran the earlier version.

I'll check the next time I run Debug Console to see if I still get the "No connection to debug console" message.

Results of that check:

11:43:29.265 [log.header]: Opening log for Oolite version 1.76 (x86-32 test release) under Windows at 2012-03-14 11:43:29 -0500.
4 processors detected.
Build options: spoken messages, mass/fuel pricing, JavaScript console support, OXP verifier, localization tools, debug GraphViz support, JavaScript profiling.
...
11:43:31.406 [debugTCP.connected]: Connected to debug console "DebugConsole".
...
11:44:48.296 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'unknown error.' (outStream status: 4, inStream status: 3)."

Windows XP Pro firewall log has no sign of dropping packets to/from 127.0.0.1 or 0.0.0.0 or my computer's LAN ip in those time intervals.
User avatar
Kaks
Quite Grand Sub-Admiral
Quite Grand Sub-Admiral
Posts: 3009
Joined: Mon Jan 21, 2008 11:41 pm
Location: The Big Smoke

Re: Updated Debug Console

Post by Kaks »

I'm afraid I've no idea why you get that message in the log. Just to be absolutely clear, what happens if you type system.government in the debug console when you see the spinnig cobra at startup?
Hey, free OXPs: farsun v1.05 & tty v0.5! :0)
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Updated Debug Console

Post by Svengali »

What happens between 11:43:31.406 and 11:44:48.296? Are you logging a lot of things?
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Updated Debug Console

Post by Switeck »

Kaks wrote:
Just to be absolutely clear, what happens if you type system.government in the debug console when you see the spinnig cobra at startup?
> system.government
> system.government
3
Svengali wrote:
What happens between 11:43:31.406 and 11:44:48.296? Are you logging a lot of things?
The other stuff was just me loading from a savegame and launching from the station...I don't even know the exact moment the debug console freaked out as the log didn't show it. I'll do some more testing to find that moment...but don't know what to look for as I'm not logging stuff that would show when/where/if Debug Console decides to disconnect.

Ok, had it happen again...while doing a while loop through all 256 systems looking for shortest path via brute-force calculations:

Code: Select all

17:39:22.031 [swi_autoJumper]: 0, .LY distance = , 8,  vs , 8,  Cur x,y:, 20, 71, Dest x,y:, 8, 105,  xDif,yDif:, 12, 17
...
17:39:22.046 [swi_autoJumper]: 126, .LY distance = , 26.8,  vs , 26.8,  Cur x,y:, 20, 71, Dest x,y:, 57, 186,  xDif,yDif:, 37, 57
17:39:22.046 [swi_autoJumper]: 127, .LY distance = , 18,  vs , 18,  Cur x,y:, 20, 71, Dest x,y:, 12, 162,  xDif,yDif:, 8, 45
17:39:22.046 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'unknown error.' (outStream status: 4, inStream status: 3)."
17:39:22.046 [swi_autoJumper]: 128, .LY distance = , 82.8,  vs , 82.8,  Cur x,y:, 20, 71, Dest x,y:, 226, 119,  xDif,yDif:, 206, 24
17:39:22.046 [swi_autoJumper]: 129, .LY distance = , 15.6,  vs , 15.6,  Cur x,y:, 20, 71, Dest x,y:, 45, 8,  xDif,yDif:, 25, 31
...
17:39:22.062 [swi_autoJumper]: 255, .LY distance = , 36,  vs , 36,  Cur x,y:, 20, 71, Dest x,y:, 78, 212,  xDif,yDif:, 58, 70
17:39:22.062 [swi_autoJumper]: shortDis 1&2 and jumpDis distances: , 0.4, 4.8, 6.4,  LY for systems , 93, 169, 118, 118, -1
Considering how quickly that loop took to conclude, (.031 seconds) it may be a red herring.

I tried it again, and same results...partway through that while-loop, Debug Console disconnects.

Code: Select all

17:56:31.984 [swi_autoJumper]: 99, .LY distance = , 22.4,  vs , 22.4,  Cur x,y:, 17, 42, Dest x,y:, 73, 62,  xDif,yDif:, 56, 10
17:56:31.984 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'unknown error.' (outStream status: 4, inStream status: 3)."
17:56:31.984 [swi_autoJumper]: 100, .LY distance = , 78,  vs , 78,  Cur x,y:, 17, 42, Dest x,y:, 212, 15,  xDif,yDif:, 195, 13
Here's what the log has in it when I'm not running the Debug Console:

13:58:46.421 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'No connection could be made because the target machine actively refused it.

' (outStream status: 7, inStream status: 7)."
13:58:46.421 [debugTCP.disconnect]: No connection to debug console: "Connection to debug console failed: 'unknown error.' (outStream status: 0, inStream status: 0)."
13:58:46.421 [debugTCP.connect.failed]: Failed to connect to debug console at address 127.0.0.1:8563.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Re: Updated Debug Console

Post by Svengali »

Reduce the amount of log calls (means collect the whole set with your loop, then log).
Switeck
---- E L I T E ----
---- E L I T E ----
Posts: 2411
Joined: Mon May 31, 2010 11:11 pm

Re: Updated Debug Console

Post by Switeck »

I was using the simple logging-on-the-fly because what I was logging wasn't going to be logged once I was happy with the results.
Were I to collect the whole set with my loop and dump it at once to the log, it would be over 20 KB.

When I remove that one log line, the error message goes away...so I was only fielding it here if there might be greater problems associated with Debug Console.
Post Reply