Class Ramaze::Logger::Informer
In: lib/ramaze/log/informer.rb
Parent: Object

A minimal logger for Ramaze, supports files, CLI, colors and some customization.

Methods

closed?   log   log_interpolate   new   shutdown   timestamp  

Included Modules

Logging Innate::Traited

Constants

COLORS = { :dev => :blue, :debug => :yellow, :info => :green, :warn => :red, :error => :red, }   Which tag should be in what color

Attributes

colorize  [RW] 
log_levels  [RW] 
out  [RW] 

Public Class methods

Create a new instance of Informer. You can spcify

Examples:

  Informer.new                    #=> logs to stdout with all levels being
                                      shown.
  Informer.new($stderr)           #=> same, but to stderr
  Informer.new("foo.log")         #=> same, but logs to the file foo.log
                                      (or creates it if it doesn't exist yet)
  Informer.new($stdout, [:info])  #=> show only #info messages to stdout.

Public Instance methods

Takes the prefix (tag), text and timestamp and applies it to the :format trait.

Close the file we log to if it isn‘t closed already.

This uses timestamp trait or a date in the format of

  %Y-%m-%d %H:%M:%S
  # => "2007-01-19 21:09:32"

[Validate]