Class: Fron::Logger

Inherits:
Object show all
Defined in:
opal/fron/core/logger.rb

Overview

Logger

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLogger

Initailizes the logger


7
8
9
# File 'opal/fron/core/logger.rb', line 7

def initialize
  @level = :info
end

Instance Attribute Details

#levelObject

Returns the value of attribute level


4
5
6
# File 'opal/fron/core/logger.rb', line 4

def level
  @level
end

Instance Method Details

#info(message) ⇒ Object

Logs the given message


14
15
16
17
18
# File 'opal/fron/core/logger.rb', line 14

def info(message)
  return if ENV == 'test'
  return if @level == :error
  puts Time.now.strftime('[%H:%M] ') + message
end