root/lib/vintage/log.rb
| Revision 1, 352 bytes (checked in by jeremymcanal..@gmail.com, 9 months ago) |
|---|
| Line | |
|---|---|
| 1 | require 'logger' |
| 2 | |
| 3 | module Vintage |
| 4 | # Class to handle logging to a file and to |
| 5 | # the console. |
| 6 | class Log |
| 7 | # Method to log something. |
| 8 | def self.enter(text = "", level = :debug) |
| 9 | @@console ||= Logger.new(STDOUT) |
| 10 | @@file ||= Logger.new('requests.log') |
| 11 | |
| 12 | @@console.send(level, text) |
| 13 | @@file.send(level, text) |
| 14 | end |
| 15 | end |
| 16 | end |
Note: See TracBrowser for help on using the browser.
