Module: Rabbit::Logger::Base
Constant Summary
Constants included from GetText
Instance Attribute Summary collapse
-
#level ⇒ Object
Returns the value of attribute level.
-
#webrick_mode ⇒ Object
Returns the value of attribute webrick_mode.
Instance Method Summary collapse
- #<<(message_or_error) ⇒ Object
- #debug(message_or_error = nil, &block) ⇒ Object
- #debug? ⇒ Boolean
- #error(message_or_error = nil, &block) ⇒ Object
- #error? ⇒ Boolean
- #fatal(message_or_error = nil, &block) ⇒ Object
- #fatal? ⇒ Boolean
- #info(message_or_error = nil, &block) ⇒ Object
- #info? ⇒ Boolean
- #initialize(level = Severity::INFO, prog_name = nil) ⇒ Object
- #log(severity, message_or_error, prog_name = nil, &block) ⇒ Object (also: #add)
- #unknown(message_or_error = nil, &block) ⇒ Object
- #unknown? ⇒ Boolean
- #warning(message_or_error = nil, &block) ⇒ Object (also: #warn)
- #warning? ⇒ Boolean
Methods included from GetText
Instance Attribute Details
#level ⇒ Object
Returns the value of attribute level.
47 48 49 |
# File 'lib/rabbit/logger/base.rb', line 47 def level @level end |
#webrick_mode ⇒ Object
Returns the value of attribute webrick_mode.
47 48 49 |
# File 'lib/rabbit/logger/base.rb', line 47 def webrick_mode @webrick_mode end |
Instance Method Details
#<<(message_or_error) ⇒ Object
86 87 88 |
# File 'lib/rabbit/logger/base.rb', line 86 def <<() info() end |
#debug(message_or_error = nil, &block) ⇒ Object
61 62 63 |
# File 'lib/rabbit/logger/base.rb', line 61 def debug(=nil, &block) log(Severity::DEBUG, , &block) end |
#debug? ⇒ Boolean
54 |
# File 'lib/rabbit/logger/base.rb', line 54 def debug?; @level <= Severity::DEBUG; end |
#error(message_or_error = nil, &block) ⇒ Object
74 75 76 |
# File 'lib/rabbit/logger/base.rb', line 74 def error(=nil, &block) log(Severity::ERROR, , &block) end |
#error? ⇒ Boolean
57 |
# File 'lib/rabbit/logger/base.rb', line 57 def error?; @level <= Severity::ERROR; end |
#fatal(message_or_error = nil, &block) ⇒ Object
78 79 80 |
# File 'lib/rabbit/logger/base.rb', line 78 def fatal(=nil, &block) log(Severity::FATAL, , &block) end |
#fatal? ⇒ Boolean
58 |
# File 'lib/rabbit/logger/base.rb', line 58 def fatal?; @level <= Severity::FATAL; end |
#info(message_or_error = nil, &block) ⇒ Object
65 66 67 |
# File 'lib/rabbit/logger/base.rb', line 65 def info(=nil, &block) log(Severity::INFO, , &block) end |
#info? ⇒ Boolean
55 |
# File 'lib/rabbit/logger/base.rb', line 55 def info?; @level <= Severity::INFO; end |
#initialize(level = Severity::INFO, prog_name = nil) ⇒ Object
48 49 50 51 52 |
# File 'lib/rabbit/logger/base.rb', line 48 def initialize(level=Severity::INFO, prog_name=nil) @level = level @prog_name = prog_name @webrick_mode = false end |
#log(severity, message_or_error, prog_name = nil, &block) ⇒ Object Also known as: add
90 91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/rabbit/logger/base.rb', line 90 def log(severity, , prog_name=nil, &block) severity ||= Severity::UNKNOWN prog_name ||= @prog_name if need_log?(severity) if .nil? and block_given? = yield end if do_log(severity, prog_name, ()) end end end |
#unknown(message_or_error = nil, &block) ⇒ Object
82 83 84 |
# File 'lib/rabbit/logger/base.rb', line 82 def unknown(=nil, &block) log(Severity::UNKNOWN, , &block) end |
#unknown? ⇒ Boolean
59 |
# File 'lib/rabbit/logger/base.rb', line 59 def unknown?; @level <= Severity::UNKNOWN; end |