Class: Slf4r::AbstractLoggerFacade
- Inherits:
-
Object
- Object
- Slf4r::AbstractLoggerFacade
- Defined in:
- lib/slf4r/abstract_logger_facade.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #debug(msg = nil, exception = nil) ⇒ Object
- #debug? ⇒ Boolean
- #error(msg = nil, exception = nil) ⇒ Object
- #error? ⇒ Boolean
- #fatal(msg = nil, exception = nil) ⇒ Object
- #fatal? ⇒ Boolean
- #info(msg = nil, exception = nil) ⇒ Object
- #info? ⇒ Boolean
-
#initialize(name) ⇒ AbstractLoggerFacade
constructor
A new instance of AbstractLoggerFacade.
- #warn(msg = nil, exception = nil) ⇒ Object
- #warn? ⇒ Boolean
Constructor Details
#initialize(name) ⇒ AbstractLoggerFacade
Returns a new instance of AbstractLoggerFacade.
35 36 37 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 35 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
33 34 35 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 33 def name @name end |
Instance Method Details
#debug(msg = nil, exception = nil) ⇒ Object
43 44 45 46 47 48 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 43 def debug(msg = nil, exception = nil) if(debug?) msg, exception = yield if block_given? _debug("#{msg}#{format(exception)}") end end |
#debug? ⇒ Boolean
39 40 41 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 39 def debug? raise NotImplementedError end |
#error(msg = nil, exception = nil) ⇒ Object
76 77 78 79 80 81 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 76 def error(msg = nil, exception = nil) if(error?) msg, exception = yield if block_given? _error("#{msg}#{format(exception)}") end end |
#error? ⇒ Boolean
72 73 74 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 72 def error? raise NotImplementedError end |
#fatal(msg = nil, exception = nil) ⇒ Object
87 88 89 90 91 92 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 87 def fatal(msg = nil, exception = nil) if(fatal?) msg, exception = yield if block_given? _fatal("#{msg}#{format(exception)}") end end |
#fatal? ⇒ Boolean
83 84 85 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 83 def fatal? raise NotImplementedError end |
#info(msg = nil, exception = nil) ⇒ Object
54 55 56 57 58 59 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 54 def info(msg = nil, exception = nil) if(info?) msg, exception = yield if block_given? _info("#{msg}#{format(exception)}") end end |
#info? ⇒ Boolean
50 51 52 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 50 def info? raise NotImplementedError end |
#warn(msg = nil, exception = nil) ⇒ Object
65 66 67 68 69 70 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 65 def warn(msg = nil, exception = nil) if(warn?) msg, exception = yield if block_given? _warn("#{msg}#{format(exception)}") end end |
#warn? ⇒ Boolean
61 62 63 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 61 def warn? raise NotImplementedError end |