module Ubea::Log
Public Instance Methods
debug(message, options = {})
click to toggle source
# File lib/ubea/log.rb, line 18 def debug(message, options = {}) info message, options if Ubea.config.debug end
info(message, options = {})
click to toggle source
# File lib/ubea/log.rb, line 7 def info(message, options = {}) options = { output: $stdout, timestamp: true }.merge(options) message = "#{Time.now} #{message}" if options.fetch(:timestamp) @semaphore.synchronize { options.fetch(:output).puts message } end
warn(message, options = {})
click to toggle source
# File lib/ubea/log.rb, line 22 def warn(message, options = {}) options = { output: $stderr }.merge(options) info "[WARN] #{message}", options end