Logging version 1.0.0
by Tim P.
Logging is a flexible logging library for use in Ruby programs based
design of Java’s log4j library. It features a hierarchical logging
custom level names, multiple output destinations per log event, custom
formatting, and more.
2 major enhancements
- Refactored access to the appenders
- Created a much cleaner way to initialize the logging framework
3 minor enhancements
- Added a YAML layout option
- Added a JSON layout option
- Cration of an “examples” directory
1 bug fix
- Logging initialization happens implicitly when a logger, layout, or
appender is created
There are two new layouts for outputting logs as using parseable
JSON and YAML. This is very nice when you want to sift through very
files looking for specific messages or sequences of messages. No more
regular expressions. Just use a JSON parser or a YAML parser to ingest
There are quite a few examples of how to use the logging framework in
“examples” directory. Please take a look at the source package to get
ideas and inspiration.
The examples also show the favored way for configuring the logging
Please take a look.
This release will introdcue backwards incompatabilities with regard to
accessing the STDOUT and STDERR appenders. The two lines below show
the old way
and the new way:
Logging::Appender.stdout # old way that no longer works
Logging.appenders.stdout # new way (similar for stderr)
Ara T. Howard gave a great talk about boulder.rb the other night.
from that meeting was the germ of this update.