Module: Devilicious::Log
- Defined in:
- lib/devilicious/log.rb
Class Method Summary collapse
- .debug(message, options = {}) ⇒ Object
- .info(message, options = {}) ⇒ Object
- .warn(message, options = {}) ⇒ Object
Class Method Details
.debug(message, options = {}) ⇒ Object
18 19 20 |
# File 'lib/devilicious/log.rb', line 18 def debug , = {} info , if Devilicious.config.debug end |
.info(message, options = {}) ⇒ Object
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/devilicious/log.rb', line 7 def info , = {} = { output: $stdout, timestamp: true }.merge() = "#{Time.now} #{}" if .fetch(:timestamp) @semaphore.synchronize { .fetch(:output).puts } end |
.warn(message, options = {}) ⇒ Object
22 23 24 25 26 |
# File 'lib/devilicious/log.rb', line 22 def warn , = {} = {output: $stderr}.merge() info "[WARN] #{}", end |