I've been writing a lot of system automation tools lately, and one of the
things I'm trying to get right is status output.
Generally output looks like:
> Doing thing .. done
> Doing other thing .. done
* Hey, your thing is ready
And we've written a tiny "Logger" class to encapsulate "tasks" (thing ..
done) and "status" messages. It uses the excellent rainbow gem to produce
coloured output for terminals and non-coloured output when piped to a file.
But I've been thinking about verbosity and task nesting. A flat log output
doesn't scale well (as anybody who's tried reading tomcat logs can attest)
so I've been thinking about log indenting. Babushka is an inspiration for
this:
Cucumber.tmbundle {
TextMate.app {
Found at /Applications/TextMate.app.
} √ TextMate.app
not already met.
Cloning from git://github.com/bmabey/cucumber-tmbundle.git... done.
Cucumber.tmbundle met.
} √ Cucumber.tmbundle
And I'd like to write code that looks like:
Logger.task("Making a new container") do
blobs.each do |blob|
Logger.task("Making new blob #{blob.name}", :verbose => true)
...
end
end
end
Before I go and extend our own libraries, does anybody know of a gem that
already does task-based nested log output?
If not, does anybody have any requests if I end up doing this myself and
making it into a gem?
--
Michael Pearson
The Bon Scotts; http://www.thebonscotts.com
--
You received this message because you are subscribed to the Google Groups "Ruby
or Rails Oceania" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rails-oceania?hl=en.