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

new(out = $stdout, log_levels = [:debug, :error, :info, :warn])

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

closed?()

is @out closed?

log(tag, *messages)

Integration to Logging.

log_interpolate(prefix, text, time = timestamp)

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

shutdown()

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

timestamp()

This uses Global.inform_timestamp or a date in the format of

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

[Validate]