Page 1 of 1

console log

Posted: Fri Jul 12, 2013 1:19 pm
by cieply
is there any way to dump console to a file from command line not by selecting text and copying?

i have started some changes in Lib/Widgets/ScorerWidgets.py and game crashes, unfortunately console disappears as well so I don't know whats is happening and cannot solve it, it would be doable only if console was immediately written to a file but don't know how to do it.

``blade.exe -console'' is not a solution as I said above

Re: console log

Posted: Fri Jul 12, 2013 3:39 pm
by prospero
Try This:

http://www.petrbnsfineart.com/bladestuf ... utfile.zip

c/p the enclosed ConsoleOutput.py file to the Lib folder to replace the existing file.

While the Debug mode is enabled this file will save the console readout to a Debug.txt file of the map you are playing to the map's folder.

Very useful. :D But don't forget to delete the debug files now and then as they get bigger and bigger. :P

If you get a total bail-out in the game then mostly it will not show any fault in the console. These CTDs are mostly triggered by graphic errors and
need a bit of detective work to track them down.

Re: console log

Posted: Tue Jul 16, 2013 2:14 pm
by cieply
ConsoleOutpt.py worked but console.log haven't helped much...

--- console.log ---
Executed sys_init.py
Executed PickInit.Init()
Done Trails.Init()
Creating tables for the bipeds...
tables created (0.578000068665 seconds)
Loading the Spider animation sets...
Found 2DMap
--- EOF console.log ---

and that's it, doesn't help a lot L(
will work on it

your ConsoleOutput.py

Posted: Tue Jul 16, 2013 2:16 pm
by cieply
# ConsoleOutput.py
i tried to change a little bit your code so it doesn't open and close output file every single line it writes
and can be opened with "wt" which would automatically accomplish removing old entries and not grow console.log to monstrous size
but well:
--- console:
(...)
G:\gamez\Blade of Darkness\bin
G:\gamez\Blade of Darkness\Maps\Casa
B_App::RunScriptFile() -> Error ejecutando Cfg.py
Start optimizing Astar...OK!
--- EOF console
and messagebox with "Player1 not declared in pj.py"
so it doesn't work, sorry I don't get python that well


--- cut Lib/ConsoleOutput.py ---

Code: Select all

#import Bladex
import Console
import sys
#import os

DEBUG_FILE = 1

class ConsoleOutput:
  softspace=0
  if DEBUG_FILE:
     if not dbg:
       dbg=open("console.log","at")  

  def write(self,message):
    if message is None:
      Console.ConsoleOutput("None")
    else:
      if DEBUG_FILE:
#      	dbg=open("Debug.txt","at")
      	dbg.write (message)
        dbg.flush()
#      	dbg.close()
      ## if DEBUG_FILE:
      Console.ConsoleOutput(message)

  def flush(self):
    pass

def InitConsole():
  ConsoleOut=ConsoleOutput()
    if DEBUG_FILE:
       dbg=open("console.log","at")
    ## if DEBUG_FILE:
  sys.stderr=sys.stdout=ConsoleOut
--- EOF cut Lib/ConsoleOutput.py ---