How to get a pop up notification of a PHP error

 So for sometime now, I've been doing Drupal/PHP development on my local machine. I'm a Mac user, and I use Growl quite a bit to keep aware of whats going on. Honestly at times its probably a productivity killer to know that I have 22 new emails, I was pinged in IRC, and my feeds were just updated, and the latest track in iTunes is something that I probably don't want to hear. So I've been spending some time thinking about how to best put this cool tool to work for me, and I kept coming back to growlnotify, a command line tool to post notifications.

My first though was, how to get this to tail some server logs for me, and how to take care of letting me know when servers had issues. But then I got to thinking that isn't really all that useful. Servers shouldn't go down, and if they do, they should notify me by email (which if I'm at the computer, Growl will pick up) and server logs? I just don't need that. The next logical conclusion was maybe to do some local tasks, like I don't know...say the PHP error log while I"m developing? That might actually be useful when I do something stupid, like get tired and call $node['body'] ( PHP Fatal error:  Cannot use object of type stdClass as array). 

Anyway, lo and behold, someone else has already done this for me. Check out the snippets here for more info on how to make this work. It's a bit tricky since growl won't send a notify until an end of file is reached, and tail -f just sends newline characters. The solution is to use a small python script to read the stdin, and then conver that into a full growlnotify command, and execute it. 

Thanks to this tip I now get notifications like this:

.

You may need to play with your error level to keep from getting splattered with notices, but I find this quite useful (especially for catching notices with Drupal 6).

Comments

Ipod Nana

Beautifull design
Thanks, webmaster.

cable to digital

Cool blog
Thanks, webmaster.

digital cable reciever

Beautifull design
Thanks, webmaster.

digital cable modem

Beautifull design
Thanks, webmaster.

best savings accounts rates

Cool blog
Thanks, webmaster.

RwqIAOeWLHg

TJwORzbThdJ

KkKcNvXVbZN

Doris Jennings

quarreler compensational spiketop preinspire wristbone castanet unperceptive novelish
http://ehxqawam.com >fhoterk luux
http://irpedj.com
http://wibrnhvqtfky.com >xagplu rjik
http://bhxraxc.com
http://nmntkqsefbl.com >egnfwf cvya
http://cdsehuvyc.com
http://xpgddca.com >jcgizin jhgqajiu
http://xqomvyf.com

Doris Jennings

quarreler compensational spiketop preinspire wristbone castanet unperceptive novelish
http://ehxqawam.com >fhoterk luux
http://irpedj.com
http://wibrnhvqtfky.com >xagplu rjik
http://bhxraxc.com
http://nmntkqsefbl.com >egnfwf cvya
http://cdsehuvyc.com
http://xpgddca.com >jcgizin jhgqajiu
http://xqomvyf.com

Doris Jennings

quarreler compensational spiketop preinspire wristbone castanet unperceptive novelish
http://ehxqawam.com >fhoterk luux
http://irpedj.com
http://wibrnhvqtfky.com >xagplu rjik
http://bhxraxc.com
http://nmntkqsefbl.com >egnfwf cvya
http://cdsehuvyc.com
http://xpgddca.com >jcgizin jhgqajiu
http://xqomvyf.com

Doris Jennings

quarreler compensational spiketop preinspire wristbone castanet unperceptive novelish
http://ehxqawam.com >fhoterk luux
http://irpedj.com
http://wibrnhvqtfky.com >xagplu rjik
http://bhxraxc.com
http://nmntkqsefbl.com >egnfwf cvya
http://cdsehuvyc.com
http://xpgddca.com >jcgizin jhgqajiu
http://xqomvyf.com

state select water heater

Amazine site
Thanks, webmaster.

keYWKiNAsVYQZPqKjGD

state select water heaters

Very amazing site
Thanks, webmaster.

state hot water heater

Cool blog
Thanks, webmaster.

state select hot water heaters

Nice site
Thanks, webmaster.

Order Viagra

Add comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options