LogIt
Description
LogIt consists of a module and window that you can add to your project to provide logging/tracing capabilities. The text you log can be written to either a floating window or a file with a
variety of timestamp formats.
Credits
"Stealing an idea is plagiarism. Stealing a bunch of ideas is research." Origin unknown.
The original version of LogIt was pretty bare-bones. It had the capability to write to a file that was opened when the project or application was starting up and was closed
when the project or application was shutting down.
When I took a look at Theo Smith's Log Example, I saw that he was opening and closing the log file on every write which has the advantage of not
losing part of the log if the project or application crashes. But, it has the disadvantage of taking more time and hammering the disk drive. So, I decided to throw in a switch so I could do it
either way.
Then, while reading Matt Neuburg's "REALbasic: The Definitive Guide", I liked his idea of logging to a window so you can see what is being written as it happens so I added
that to LogIt too and threw in a switch to select window or file logging.
Requirements
- REALbasic 2.1a1 or above. The code in LogIt should work just fine in an earlier version, but the file format changed at 2.1a1 so you'll have to cut & paste the the guts yourself.
Features
- Log to either a window or file.
- Thanks to Rolf Heller, the window will optionally keep the last line visible.
- Timestamp entries with date & time, seconds, ticks, or microseconds. Or, no timestamps at all.
- Timestamps, for ticks or microseconds, can be relative to system startup, log opening, or last logged event.
- "Write immediate" option (file logging only) closes the log file after every entry so that entries won't be lost if you application or the system crashes.
- Configurable with just a few lines in your Application Subclass's open event.
- Open source. Can be carved up any way you like.
- It's WhiskeyWare. The idea here is that if you use and like LogIt then you send me something that I use and like in return, a sample of your favorite whiskey.
Version History
-
LogIt version 2.3 - 01/17/00
- Now shown to work in builds for Windows platforms whether logging to file or window.
- Fixed some bugs: Show Last Line checkbox is now locked to window; checking Show Last Line now moves the insertion point to the end of the window instead of selecting all the text
(Windows-only problem); line-termination now properly set for the target platform.
- Updated the ReadMe file with information on Windows platforms.
-
LogIt version 2.2 - 01/09/00
- Thanks to Rolf Heller, added a checkbox to the window to, optionally, keep the last line visible.
- Updated the ReadMe file.
-
LogIt version 2.1 - 01/07/00
- Added options for timestamping relative to system startup, log opening, and last logged event.
- Improved the descriptions in the ReadMe file.
-
LogIt version 2.0.1 - 01/02/00
- Changed the logging window's editfield to read-only and added a ReadMe file.
-
LogIt version 2.0 - 12/13/99
- Many feature additions, including logging to a window.
- LogIt version 1.0 - 02/27/99
Download
You'll need Stuffit Expander 5.5, or later to expand this archive.
LogIt version 2.3
You can send questions/suggestions/comments to me here.