Class: GithubHook::MessageLogger

Inherits:
Object
  • Object
show all
Defined in:
app/services/github_hook/message_logger.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(wrapped_logger = nil) ⇒ MessageLogger

Returns a new instance of MessageLogger.



5
6
7
8
# File 'app/services/github_hook/message_logger.rb', line 5

def initialize(wrapped_logger = nil)
  @messages = []
  @wrapped_logger = wrapped_logger
end

Instance Attribute Details

#messagesObject (readonly)

Returns the value of attribute messages.



3
4
5
# File 'app/services/github_hook/message_logger.rb', line 3

def messages
  @messages
end

#wrapped_loggerObject (readonly)

Returns the value of attribute wrapped_logger.



3
4
5
# File 'app/services/github_hook/message_logger.rb', line 3

def wrapped_logger
  @wrapped_logger
end

Instance Method Details

#debug(message = yield)) ⇒ Object



10
11
12
# File 'app/services/github_hook/message_logger.rb', line 10

def debug(message = yield)
  add_message(:debug, message)
end

#error(message = yield)) ⇒ Object



14
15
16
# File 'app/services/github_hook/message_logger.rb', line 14

def error(message = yield)
  add_message(:error, message)
end

#fatal(message = yield)) ⇒ Object



18
19
20
# File 'app/services/github_hook/message_logger.rb', line 18

def fatal(message = yield)
  add_message(:fatal, message)
end

#info(message = yield)) ⇒ Object



22
23
24
# File 'app/services/github_hook/message_logger.rb', line 22

def info(message = yield)
  add_message(:info, message)
end

#warn(message = yield)) ⇒ Object



26
27
28
# File 'app/services/github_hook/message_logger.rb', line 26

def warn(message = yield)
  add_message(:warn, message)
end