From: Brian Marick Date: 2002-01-17T07:36:11+09:00 Subject: Re: Announcing Log4r - A flexible logger for Ruby At 06:41 PM 1/14/02, you wrote: >On Tue, 15 Jan 2002, Brian Marick wrote: > > > 2) It might be good to predefine a Formatter that prints the > > location a log message came from. Like this: > > > > netapp.rb:13:in `initialize' > >Do you mean the execution trace? That's generated when requested :) Whenever the code logs a message, I'd like to see what line of code it came from. So when I find a log message like "Move successful!" I can go to the code and see what on earth that means. (Because I print locations in normal Ruby form and use Emacs, I can go to the source with a single command, ^h^h in my case.) The format I showed is kind of verbose. Here's another example. I use my tracing system to put "todo" messages in the code or the tests. These are like the comments you sometimes see: # XXX - clean this up someday. def a_method... except they're executable: todo 'clean this up someday' def a_method... Normally, they're not displayed, but I can turn them on to see something like this: TODO: Do I care to test whether the parser works if the link comes before the title? (./util.rb:71) TODO: If there are no changes, don't send mail? Don't update what was sent last? (All.rb:8) TODO: Do wikis ever order the changes increasing instead of decreasing? (All.rb:9) (Note: the version of Ruby-Trace on my web site doesn't have the newest todo code.) -- Brian Marick, marick@testing.com www.testing.com - Software testing services and resources www.testingcraft.com - Where software testers exchange techniques www.visibleworkings.com - Adequate understanding of system internals