Class | Ramaze::Logger::Informer |
In: |
lib/ramaze/log/informer.rb
|
Parent: | Object |
A minimal logger for Ramaze, supports files, CLI, colors and some customization.
COLORS | = | { :dev => :blue, :debug => :yellow, :info => :green, :warn => :red, :error => :red, } | Which tag should be in what color |
colorize | [RW] | |
log_levels | [RW] | |
out | [RW] |
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.
Takes the prefix (tag), text and timestamp and applies it to the :format trait.
This uses timestamp trait or a date in the format of
%Y-%m-%d %H:%M:%S # => "2007-01-19 21:09:32"