Class: CouchPopulator::Logger
- Inherits:
-
Object
- Object
- CouchPopulator::Logger
- Defined in:
- lib/logger.rb
Instance Method Summary collapse
- #<<(message) ⇒ Object
-
#initialize(logfile = '') ⇒ Logger
constructor
A new instance of Logger.
- #log(message) ⇒ Object
Constructor Details
#initialize(logfile = '') ⇒ Logger
Returns a new instance of Logger.
3 4 5 |
# File 'lib/logger.rb', line 3 def initialize(logfile='') @out = logfile.empty? ? $stdout : File.new(logfile, "a") end |
Instance Method Details
#<<(message) ⇒ Object
12 13 14 |
# File 'lib/logger.rb', line 12 def <<() log() end |
#log(message) ⇒ Object
7 8 9 10 |
# File 'lib/logger.rb', line 7 def log() t = Time.now @out << "#{t.strftime("%Y-%m-%d %H:%M:%S")}:#{t.usec} :: #{} \n" end |