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.
@example
Informer.new # => logs to stdout with all levels being shown. Informer.new($stderr) # => same, but to stderr # same, but logs to the file foo.log (or creates it if it doesn't # exist yet) Informer.new("foo.log") Informer.new($stdout, [:info]) #=> show only #info messages to stdout.
@param [String] out Specifies where the output should go. By default
this is set to STDOUT.
@param [Array] log_leves Array containing the levels that should be
logged.
Takes the prefix (tag), text and timestamp and applies it to the :format trait.
@param [String] prefix @param [String] text @param [Integer] time
This uses timestamp trait or a date in the format of
%Y-%m-%d %H:%M:%S # => "2007-01-19 21:09:32"