Class: Pazuzu::Utility::AnnotatedLogger

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/pazuzu/utility/annotated_logger.rb

Overview

Logger which annotates all log messages.

Instance Method Summary collapse

Constructor Details

#initialize(logger, prefix) ⇒ AnnotatedLogger

Returns a new instance of AnnotatedLogger.

[View source]

7
8
9
10
# File 'lib/pazuzu/utility/annotated_logger.rb', line 7

def initialize(logger, prefix)
  super(logger)
  @prefix = prefix
end

Instance Method Details

#add(severity, message = nil, progname = nil, &block) ⇒ Object

[View source]

28
29
30
# File 'lib/pazuzu/utility/annotated_logger.rb', line 28

def add(severity, message = nil, progname = nil, &block)
  __getobj__.add(severity, format_message(message), progname, &block)
end

#debug(message = nil, &block) ⇒ Object

[View source]

12
13
14
# File 'lib/pazuzu/utility/annotated_logger.rb', line 12

def debug(message = nil, &block)
  __getobj__.debug(format_message(message), &block)
end

#error(message = nil, &block) ⇒ Object

[View source]

24
25
26
# File 'lib/pazuzu/utility/annotated_logger.rb', line 24

def error(message = nil, &block)
  __getobj__.error(format_message(message), &block)
end

#info(message = nil, &block) ⇒ Object

[View source]

16
17
18
# File 'lib/pazuzu/utility/annotated_logger.rb', line 16

def info(message = nil, &block)
  __getobj__.info(format_message(message), &block)
end

#warn(message = nil, &block) ⇒ Object

[View source]

20
21
22
# File 'lib/pazuzu/utility/annotated_logger.rb', line 20

def warn(message = nil, &block)
  __getobj__.warn(format_message(message), &block)
end