I enjoy programming for a variety of fields, and am familiar with using the command line and Terminal for many of the associated tasks with the edit-compile-run cycle used for many languages. However, the longer I use the Mac, the less I want to use the Terminal.
One way to fix the problem is to let your editor or AppleScript take care of the compiler running, and even display if the output is going to be small. However, if you're trying to read the log from a larger program's execution, you may want to try opening the log file with Console.app. You won't accidentaly edit the output, and when you run your test, Console.app automatically figures out that the file has been updated and reloads it.
BTW, these file can be any kind of plain text file (not just ones with the ".log" extension).
Mac OS X Hints
http://hints.macworld.com/article.php?story=20051113035049561