GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: A flexible logging library for use in Ruby programs based on the design of Java's log4j library.
Homepage: http://logging.rubyforge.org/
Clone URL: git://github.com/TwP/logging.git
Tim Pease (author)
Wed Jul 16 18:06:51 -0700 2008
commit  6c66ea5d3c77a9a88cfdfc9e179bcd2b41087866
tree    58a00b64e65e313e50825facc9cef67c54812afc
parent  000c1bfcc2c7d6ea9b6cd72906ac6dbe3d607016
name age message
file History.txt Mon Oct 27 08:52:38 -0700 2008 Fixing an uncaught timeout error in the e-mail ... [Tim Pease]
file Manifest.txt Thu Dec 04 16:14:22 -0800 2008 Refactored the buffering logic into an includab... [Tim Pease]
file README.txt Wed Feb 13 09:21:56 -0800 2008 stupid updates [Tim Pease]
file Rakefile Tue Oct 21 07:54:17 -0700 2008 Now using the latest Mr Bones version. [Tim Pease]
directory data/ Wed Jul 16 18:06:51 -0700 2008 Adding tests for the DSL configurator. [Tim Pease]
directory lib/ Thu Dec 04 17:58:25 -0800 2008 finishing up the documentation [Tim Pease]
directory tasks/ Wed Jul 02 11:01:04 -0700 2008 New rubyforge task that plays nice with the rub... [Tim Pease]
directory test/ Thu Dec 04 16:14:22 -0800 2008 Refactored the buffering logic into an includab... [Tim Pease]
README.txt
Logging
    by Tim Pease

* {Homepage}[http://logging.rubyforge.org/]
* {Rubyforge Project}[http://rubyforge.org/projects/logging]
* email tim dot pease at gmail dot com

== DESCRIPTION

Logging is a flexible logging library for use in Ruby programs based on the
design of Java's log4j library. It features a hierarchical logging system,
custom level names, multiple output destinations per log event, custom
formatting, and more.

== INSTALL

   sudo gem install logging

== EXAMPLE

This example configures a logger to output messages in a format similar to the
core ruby Logger class. Only log messages that are warnings or higher will be
logged.

   require 'logging'

   logger = Logging.logger(STDOUT)
   logger.level = :warn

   logger.debug "this debug message will not be output by the logger"
   logger.warn "this is your last warning"

In this example, a single logger is crated that will append to STDOUT and to a
file. Only log messages that are informational or higher will be logged.

   require 'logging'

   logger = Logging::Logger['example_logger']
   logger.add_appenders(
       Logging::Appender.stdout,
       Logging::Appenders::File.new('example.log')
   )
   logger.level = :info

   logger.debug "this debug message will not be output by the logger"
   logger.info "just some friendly advice"

The Logging library was created to allow each class in a program to have its
own configurable logger. The logging level for a particular class can be
changed independently of all other loggers in the system. This example shows
the recommended way of accomplishing this.

   require 'logging'

   Logging::Logger['FirstClass'].level = :warn
   Logging::Logger['SecondClass'].level = :debug

   class FirstClass
     def initialize
       @log = Logging::Logger[self]
     end

     def some_method
       @log.debug "some method was called on #{self.inspect}"
     end
   end

   class SecondClass
     def initialize
       @log = Logging::Logger[self]
     end

     def another_method
       @log.debug "another method was called on #{self.inspect}"
     end
   end

== NOTES

Although Logging is intended to supersede Log4r, it is not a one-to-one
replacement for the Log4r library. Most notably is the difference in namespaces
-- Logging vs. Log4r. Other differences include renaming Log4r::Outputter to
Logging::Appender and renaming Log4r::Formatter to Logging::Layout. These
changes were meant to bring the Logging class names more in line with the Log4j
class names.

== REQUIREMENTS

Logging does not depend on any other installed libraries or gems.

== LICENSE

Ruby