Provides file logging capability
Picombo has the following log levels
0 - Disable logging (none)
1 - Errors and exceptions (info)
2 - Warnings (warning)
3 - Notices (notice)
4 - Debugging (debug)
The log level is set in config/log.yaml
To write a log entry, do Picombo::Log.instance().write(:info, ‘This is the message!’)
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.
Generated with the Darkfish Rdoc Generator 1.1.6.