I use a logger. Most of the time. But though I’m ashamed to admit it -  Sometimes I go loco with traces. Sometimes I just can’t help myself, and before I know it, I have obscure messages popping up in my console from places I had forgotten existed. Usually these binges happen as I try and chase something down, and when I manage to sober up,  I need some way of cleaning up quick. Before anyone finds out. Before my dirty little habit is exposed.

This little string of characters does my caretaking for me. Its a simple Regx that matches all the traces in your project.

trace\(.*?\);?

In Eclipse (FDT/FB):

  1. Open the search panel: Search from the menu then open the File Search tab
  2. Paste: trace\(.*?\);? into the Containing text: input box.
  3. Tick the Regular expression Checkbox over to the right.
  4. Make sure File name patterns input box contains the right file types for your project. For Actionscript and MXML it should look like this: *.as, *.mxml
  5. Click Search or Replace…

I also use this in my ANT build file for any release builds.

<replaceregexp
	match="trace\(.*?\);?"
	replace=""
	flags="gs">
	<fileset
		dir="${temp.dir}"
		includes="**/*.as"/>
	<fileset
		dir="${temp.dir}"
		includes="**/*.mxml"/>
</replaceregexp>

For lots more ANT goodness check out AntFunk


Subscribe to comments Comment | Trackback |
Post Tags:

Browse Timeline


Add a Comment


XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>


© Copyright 2007 1ndivisible . Thanks for visiting!