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.
34 35 36 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 34 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
32 33 34 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 32 def name @name end |
Instance Method Details
#debug(msg = nil, exception = nil) ⇒ Object
42 43 44 45 46 47 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 42 def debug(msg = nil, exception = nil) if(debug?) msg, exception = yield if block_given? _debug("#{msg}#{format(exception)}") end end |
#debug? ⇒ Boolean
38 39 40 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 38 def debug? raise NotImplementedError end |
#error(msg = nil, exception = nil) ⇒ Object
75 76 77 78 79 80 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 75 def error(msg = nil, exception = nil) if(error?) msg, exception = yield if block_given? _error("#{msg}#{format(exception)}") end end |
#error? ⇒ Boolean
71 72 73 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 71 def error? raise NotImplementedError end |
#fatal(msg = nil, exception = nil) ⇒ Object
86 87 88 89 90 91 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 86 def fatal(msg = nil, exception = nil) if(fatal?) msg, exception = yield if block_given? _fatal("#{msg}#{format(exception)}") end end |
#fatal? ⇒ Boolean
82 83 84 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 82 def fatal? raise NotImplementedError end |
#info(msg = nil, exception = nil) ⇒ Object
53 54 55 56 57 58 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 53 def info(msg = nil, exception = nil) if(info?) msg, exception = yield if block_given? _info("#{msg}#{format(exception)}") end end |
#info? ⇒ Boolean
49 50 51 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 49 def info? raise NotImplementedError end |
#warn(msg = nil, exception = nil) ⇒ Object
64 65 66 67 68 69 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 64 def warn(msg = nil, exception = nil) if(warn?) msg, exception = yield if block_given? _warn("#{msg}#{format(exception)}") end end |
#warn? ⇒ Boolean
60 61 62 |
# File 'lib/slf4r/abstract_logger_facade.rb', line 60 def warn? raise NotImplementedError end |