Class: SkinnyControllers::Logging::Logger

Inherits:
Object
  • Object
show all
Defined in:
lib/skinny_controllers/logging.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeLogger

Returns a new instance of Logger.



13
14
15
16
# File 'lib/skinny_controllers/logging.rb', line 13

def initialize
  @_logger = ActiveSupport::TaggedLogging.new(ActiveSupport::Logger.new(STDOUT))
  @_tag = 'skinny_controllers'
end

Instance Attribute Details

#_loggerObject

Returns the value of attribute _logger.



11
12
13
# File 'lib/skinny_controllers/logging.rb', line 11

def _logger
  @_logger
end

#_tagObject

Returns the value of attribute _tag.



12
13
14
# File 'lib/skinny_controllers/logging.rb', line 12

def _tag
  @_tag
end

Instance Method Details

#info(*args) ⇒ Object



22
23
24
# File 'lib/skinny_controllers/logging.rb', line 22

def info(*args)
  _logger.tagged(_tag) { _logger.info(*args) }
end

#warn(*args) ⇒ Object



18
19
20
# File 'lib/skinny_controllers/logging.rb', line 18

def warn(*args)
  _logger.tagged(_tag) { _logger.warn(*args) }
end