Skip to Content »

FlashApe » View trace() statements in the terminal on os x

 View trace() statements in the terminal on os x

  • May 27th, 2007
  • 1:58 pm

Today I went to go set up the FlashTracer extension for firefox. Normally I don’t use firefox, i was just going to use it for that specific plugin so I could view the trace stements while my swf was in the browser. I couldn’t actually get it to work, so I started looking around and found this post which had pretty much all the info I needed. There’s a lot of info on that page, but it turns out it’s a pretty easy task:

  • Get the debug player if you don’t have it already.
  • run this command in the terminal, just be sure to replace ‘username’ with your actual username :
    tail -f /Users/username/Library/Preferences/Macromedia/Flash\ Player/Logs/flashlog.txt

There was some info in the other post about creating and editing a file named ‘mm.cfg’, but I already had that installed (maybe because I already had and ran the debug player?) so I didn’t need to do anything with that.

I saved the command from Terminal as a file so I can just double-click on it and run that command:

save  command

To make it a little easier to view the output, I went and grabbed a small app named Afloat, which allows you to specify that a window should always remain on top. This way i don’t have to constantly switch between the browser and the terminal window.

10 People had this to say...

Gravatar

Nice! Thanks for the tip.

Gravatar
  • ethan
  • May 27th, 2007
  • 6:31 pm

I have found that just opening the flashlog.txt file in console.app is the easiest way. -ethan

Gravatar
  • rich
  • May 27th, 2007
  • 6:57 pm

nice ethan, thats cool too, plus in the console you get the marker.

Gravatar

I have this now in my .bash_profile file under Mac, works great:


### From http://www.websector.de/blog/2007/02/21/are-you-looking-for-afterthought-on-os-x/
# opens “flashlog.txt” in Console
alias trace=’open -a /Applications/Utilities/Console.app/ ~/Library/Preferences/Macromedia/Flash\ Player/Logs/flashlog.txt’
# clears “flashlog.txt”
alias cleartrace=’echo > ~/Library/Preferences/Macromedia/Flash\ Player/Logs/flashlog.txt’

Gravatar

Check out these tutorials for an easier logging “flashlog.txt” on OS X, too ;-)


trace() outside the Flash IDE with tail

Are you looking for AFTERTHOUGHT on OS X?

-sectore

Gravatar
  • barry.b
  • May 28th, 2007
  • 6:41 am

I don’t get it.

I’m sure I installed the debug player when I installed Flexbuilder a couple of months ago

and sure enough, when I write crap Flex code, the flash player tells me (more or less) what I did wrong on runtime errors.

AND … I’ve just re-installed it again, based on yours and the other article.

but I’ll be blowed if I can find flashlog.txt anywhere. The /Library path is correct up to (just before) /Logs and then it’s all wrong.

but /Users/username/Library/Preferences/Macromedia/Flash\ Player/ must be correct ‘cos that’s where my LocalSO’s are.

wierd.

Gravatar
  • rich
  • May 28th, 2007
  • 8:49 am

nice, i guess from all the comments that this has been covered a bunch of times before.

barry - why don’t you do a spotlight search for flashlog.txt? if you still don’t find it, maybe start do a ‘debug movie’ (instead of ‘test movie’) once and it might show up.

Gravatar
  • JasonM
  • June 8th, 2007
  • 12:33 am

I’d suggest you use Console on the mac instead

All you have to do is open the flashlog.txt file (use spotlight to find it)

Once console has it open you can use the filter to search for ERROR, WARN, INFO, DEBUG, (etc.) or a specific search term…

Tail is cool, but console is Tail on, er, Meth!

Gravatar
  • JasonM
  • June 8th, 2007
  • 12:34 am

(Sorry ethan just noticed you already suggested console!)

Gravatar
  • PeterC
  • March 2nd, 2008
  • 9:10 pm

In addition to Erik’s comment, creating a symbolic link of flashlog.txt to your Log directory will place the file in the log list drawer.

ln -s ~/Library/Preferences/Macromedia/Flash\ Player/Logs/flashlog.txt ~/Library/Logs/flashlog.txt

Want your say?

* Required fields. Your e-mail address will not be published on this site


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