Parent

Methods

Included Modules

Picombo::Log

Provides file logging capability

Log Levels

Picombo has the following log levels

The log level is set in config/log.yaml

To write a log entry, do Picombo::Log.instance().write(:info, ‘This is the message!’)

Public Class Methods

write(type, message) click to toggle source

Writes log entry with level type with message

    # File lib/classes/log.rb, line 20
20:         def self.write(type, message)
21:             types = {:none => 0, :info => 1, :warning => 2, :notice => 3, :debug => 4}
22: 
23:             if types[type] <= Picombo::Config.get('log.log_threshold')
24:                 t = Time.now
25:                 f = File.new(::APPPATH+Picombo::Config.get('log.directory')+t.year.to_s+'-'+t.month.to_s+'-'+t.day.to_s+'.log', 'a')
26:                 f.write(t.to_s+' --- '+type.to_s+': '+message.to_s+"\n");
27:                 f.close
28:             end
29:         end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.