Module: BackchatClient::BackchatLogger

Included in:
Backchat, Backchat::Client, Channel, HttpClient, Stream, User
Defined in:
lib/backchat_client/backchat_logger.rb

Overview

This module injects methods to handle log mechanism

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

Nice way to include the Module methods when including it in a class/module



12
13
14
# File 'lib/backchat_client/backchat_logger.rb', line 12

def self.included(base)
  base.extend(ClassMethods)
end

Instance Method Details

#debug(message) ⇒ Object

debug message with the class name a the beginning of the log



65
66
67
# File 'lib/backchat_client/backchat_logger.rb', line 65

def debug(message)
  logger.debug "#{self.class} #{message}"
end

#error(message) ⇒ Object

error message with the class name a the beginning of the log



70
71
72
# File 'lib/backchat_client/backchat_logger.rb', line 70

def error(message)
  logger.error "#{self.class} #{message}"
end

#loggerObject



60
61
62
# File 'lib/backchat_client/backchat_logger.rb', line 60

def logger
  self.class.logger
end