If you compile with Mtasc you can just add a parameter to replace all
traces. For example:
-trace "com.blitzagency.xray.util.MtascUtility.trace"
This traces everything to Xray, while it also keeps working in the Flash
IDE. And on top of that, it automatically adds the Class, Function and
line number where the call was made. With a little extra code it also
traces objects (indented).
I love it! No more trace(">>>>> myvar = " + myvar);
If you already use FDT it's as simple as adding the location of Mtasc to
your preferences.
Good luck!
Michiel van der Ros
Weyert de Boer wrote:
> I just finished the script! But I am still interested if I can change
> existing swf files, though.
>
> The source code of the Ruby script is below, it basically scans
> recursively through the source-directory
> for as files and tries to find the trace(-statement and replaces it my
> the logger statement instead. One that
> works with logviewer which can except incoming stuff from xmlsocket and
> telnet. Really net for client
> and server debugging/logging ;)
>
> require 'fileutils'
>
> TRACE_STATEMENT = "trace("
> LOGGER_STATEMENT = "com.innerfuse.logging.Loggger.log("
>
> Dir.glob("source/**/*.as").each do |file|
> puts "Modifying file: #{file}..."
>
> # make copy of the original file and .bak
> replace_file = file
> backup_file = file + ".bak"
> FileUtils.copy_file( file, backup_file, true)
> FileUtils.remove_file( file )
>
> # open the file
> File.open( replace_file, "w+" ) do |rf|
> replace_count = 0
> File.open( backup_file ) do |of|
> of.each_line do |line|
> rf << line.gsub( TRACE_STATEMENT ) { replace_count+=1;
> LOGGER_STATEMENT }
> end
> end
> puts "File replace count: #{replace_count}"
> end
> end
>
>
> _______________________________________________
> osflash mailing list
> [email protected]
> http://osflash.org/mailman/listinfo/osflash_osflash.org
>
--
[ weblog ][ http://michiel.vanderros.nl ]
_______________________________________________
osflash mailing list
[email protected]
http://osflash.org/mailman/listinfo/osflash_osflash.org