You have to install growlnotify (its one of the Growl Extras). Then I set this up in a file called tail2grow.sh. Whenever I'm about to start programming, I open up a terminal window and type tailf2growl.sh /var/log/apache2/error_log &. You can set it to run all the time also, of course.
- Code: Select all
#!/bin/sh
if [ -z "$1" ]; then
echo "Missing filename"
exit 1
fi
tail -n0 -F $1 | while read; do
echo $REPLY | cut -d' ' -f6,9- | growlnotify -a tailfgrowl -t $1;
done
Beware that sometimes you'll put a error_log in a location that gets hit 50 times and... well... you'll get about 50 notifications popping up on your screen. If you end up playing around a bit with cut and/or awk to clean up the output a little bit, pass that along to me. I've been meaning to do that for a while, but I hate playing around with those commands.
Eclipse is great, although a little sluggish. You have to install PHPEclipse plugin to get proper syntax highlighting, etc. I actually wish I could just learn to use TextMate to do all the things that are easily accessible in Eclipse. TextMate (and probably also BBEdit) are far superior text editors, but getting all the definition lookup, patch making, and CVS integration requires some setup and well, I simply can't be bothered.