Module: Offshore::Logger

Extended by:
Logger
Included in:
Logger
Defined in:
lib/offshore/server/logger.rb

Instance Method Summary collapse

Instance Method Details

#error(message) ⇒ Object



18
19
20
# File 'lib/offshore/server/logger.rb', line 18

def error(message)
  say(:error, message)
end

#info(message) ⇒ Object



14
15
16
# File 'lib/offshore/server/logger.rb', line 14

def info(message)
  say(:info, message)
end

#say(type, message) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/offshore/server/logger.rb', line 5

def say(type, message)
  message = "[Offshore][#{type}][#{Time.now.to_i}][#{Time.now}] #{message}"
  if defined?(Rails)
    Rails.logger.send(type, message)
  else
    puts message
  end
end