README.rdoc in loggability-0.0.1 vs README.rdoc in loggability-0.0.2
- old
+ new
@@ -14,20 +14,36 @@
up later when you know where you want logs to be written, at what level of
severity, and in which format.
An example:
- # Load a bunch of libraries
- require 'strelka'
- require 'inversion'
- require 'treequel'
- require 'loggability'
-
+ # Load a bunch of libraries that use Loggability
+ require 'strelka'
+ require 'inversion'
+ require 'treequel'
+ require 'loggability'
+
+ # Set up our own library
+ module MyProject
+ extend Loggability
+ log_as :my_project
+
+ class Server
+ extend Loggability
+ log_to :my_project
+
+ def initialize
+ self.log.debug "Listening."
+ end
+ end
+
+ end
+
# Now tell everything that's using Loggability to log to an HTML
- # log file at INFO level
- Loggability.write_to( '/usr/local/www/htdocs/log.html' )
- Loggability.format_as( :html )
- Loggability.level = :info
+ # log file at INFO level
+ Loggability.write_to( '/usr/local/www/htdocs/log.html' )
+ Loggability.format_as( :html )
+ Loggability.level = :info
== Prerequisites
* Ruby 1.9.3 or better, Rubinius 2.0 or better