Class: Gerrit2jiracomment::LoggerWithTag
- Inherits:
-
Object
- Object
- Gerrit2jiracomment::LoggerWithTag
- Defined in:
- lib/gerrit2jiracomment.rb
Overview
wrapper for a logger that always adds tags
Instance Method Summary collapse
- #debug(message) ⇒ Object
- #error(message, error) ⇒ Object
- #fail(c, message) ⇒ Object
- #info(message) ⇒ Object
-
#initialize(log, tag) ⇒ LoggerWithTag
constructor
A new instance of LoggerWithTag.
Constructor Details
#initialize(log, tag) ⇒ LoggerWithTag
Returns a new instance of LoggerWithTag.
17 18 19 20 |
# File 'lib/gerrit2jiracomment.rb', line 17 def initialize(log, tag) @log = log @tag = tag end |
Instance Method Details
#debug(message) ⇒ Object
22 23 24 |
# File 'lib/gerrit2jiracomment.rb', line 22 def debug() @log.debug("#{@tag}†#{}") end |
#error(message, error) ⇒ Object
30 31 32 33 |
# File 'lib/gerrit2jiracomment.rb', line 30 def error(, error) = "#{error} #{error.backtrace.join('\\n\\t')}" @log.error("#{@tag}†#{}: #{}") end |
#fail(c, message) ⇒ Object
35 36 37 |
# File 'lib/gerrit2jiracomment.rb', line 35 def fail(c, ) raise(c, "#{@tag}†#{}") end |
#info(message) ⇒ Object
26 27 28 |
# File 'lib/gerrit2jiracomment.rb', line 26 def info() @log.info("#{@tag}†#{}") end |