BetterConsole 1.3.0
Introduction
Welcome to a BetterConsole.
BetterConsole is a freeware application that you can use to display messages written to the console, or any sort of log file. I am a bit disappointed with the Workspace console that NeXT/Apple provides with the OpenStep/Rhapsody, so I worked up this little replacement. It has the following features which I (and others) think are necessary but are missing in the standard Workspace console:
-
NEW in 1.3.0! Feature request by Jürgen Möllenhoff
OpenStep build has been fattened up with a Sparc binary.
-
NEW in 1.3.0! Feature request by Noone Inparticular
Did more restructuring and GUI enhancement in preparation for multiple console support. New toys include a collapsing tool bar, an inspector panel that cleans up file selection, and user-editable check times for rotating files.
-
NEW in 1.2.0! Feature request by Elliot Silver
Follow "rotating" log files. Move or remove a file and BetterConsole will, within a minute, try to re-follow the initially named file. It doesn't do anything fancy to determine the file status, it just checks to see if the file has gotten smaller, which log files shouldn't do.
-
NEW in 1.2.0! Feature request by Noone Inparticular
Did some major internal reorganization; BetterConsole has gone beyond a quick hack. If you have any problems, let me know immediately.
-
NEW in 1.1.0! Feature request by Jack Nutting
Follow multiple files. I'm not saying it's pretty, but it's in there.
-
NEW in 1.1.0! Feature request by Jack Nutting
Making the application active will show the console. In general, the activity mechanism should seem more logical, especially with respect to auto-close.
-
NEW in 1.1.0! Feature request by Noone Inparticular
Allow preferences to be set. Currently the following information can be changed and saved: auto-close status, inactivity timeout, console empty status, and the file(s) to monitor.
-
NEW in 1.0.1! Feature request by Scott Anguish
Hide the empty console after a period of inactivity. Because of the initial features, a common sequence for users was a clean followed by a close. By automatically hiding 30 seconds after a clean (with no activity), the user no longer has to perform the close.
-
NEW in 1.0.1! Feature request by Noone Inparticular
Compiled an OpenStep 4.2 version. The OpenStep console is even less reasonable than the Rhapsody one, so I did this "port" to salvage my sanity.
-
Show the window when something is written to the console. This allows you keep the console window closed without fear of missing messages.
-
Bring the window to the front when something is written to the console. I prefer that console messages are actively brought to my attention.
-
Be bloody fast. The standard console is amazingly slow. BetterConsole is about twice as fast as a "cat" in Terminal and 25 times(!) faster than the standard console. As an example of how much faster BetterConsole can be, have the standard console take up the left half of the screen, have BetterConsole take up the right half, and then "cat >>" a ~32k file to the /tmp/console.log file. Prepare to wait minutes (about 2 minutes on my 8600) for the standard console to finish displaying what BetterConsole cranks out in mere seconds.
Known Bugs
- Document icon appears in title bar when no single log file is followed.
There is a bug in Apple's Rhapsody NSWindow implementation regarding represented files. It appears that once you've set it to something, you cannot clear it out.
- Startup and setting preferences is slow.
There also appears to be some sort of timing bug in NSTask. I noticed this when implementing the rotating log files features. What BetterConsole tries to do when a file is moved is to follow the new file from the beginning, so that all the log entries are displayed. For some reason, although the tail process seems to be launched correctly, the full output didn't always make its way to the task's read filehandle. It was more reliable when I was debugging the code, which made me think it's a timing problem. Scattering a few sleep() statements around the code allowed me to narrow down where the problem occurred. Don't ask me why, but it appears to be critical to do a little sleeping after an NSTask is created. Unless you monitor more than a handful of log files, you probably won't notice any speed hit at all.
- In the OpenStep version, the toolbar resizes instead of just collapsing.
OpenStep doesn't support proper collapsing; it's a new addition to NSSplitView. It may not work as slick without it, but the ability to get rid of the toolbar is still there, which is the important thing.
- In the OpenStep version, changes to the size and/or order of the monitored files table in the inspector aren't saved.
Again, it's an OpenStep thing.
Building the Code
This code was built for Rhapsody DR2 (aka, MacOS X Server; aka, Server X) on a PPC machine and for OpenStep 4.2 on an Intel machine. It should just work.
Restrictions
Please don't distribute modified versions of this application.
Possible Future Enhancements
- Feature request by Guillaume Lessard: allow the console font to be set.
- Support multiple windows/documents for monitoring multiple files.
- Play a sound instead/in addition to bring the window to the front.
- Your suggestion/code addition here.
Version History
30 Jul 1998 - Original version
20 Aug 1998 - 1.0.1
26 Aug 1998 - 1.1.0
04 Oct 1998 - 1.2.0
28 Oct 1998 - 1.3.0
Contact Information
Please direct email regarding this application to BetterConsole@subsume.com.
Please go to http://www.subsume.com/ for other information about Subsume Technologies, Inc.
Copyright © 1998 Subsume Technologies, Inc.