Class: Nutella::NutellaLogger
- Inherits:
-
Object
- Object
- Nutella::NutellaLogger
- Defined in:
- lib/logging/nutella_logger.rb
Direct Known Subclasses
Instance Method Summary collapse
- #debug(message, code = nil) ⇒ Object
- #error(message, code = nil) ⇒ Object
- #info(message, code = nil) ⇒ Object
-
#initialize(name) ⇒ NutellaLogger
constructor
A new instance of NutellaLogger.
- #success(message, code = nil) ⇒ Object
- #warn(message, code = nil) ⇒ Object
Constructor Details
#initialize(name) ⇒ NutellaLogger
Returns a new instance of NutellaLogger.
8 9 10 11 12 13 14 |
# File 'lib/logging/nutella_logger.rb', line 8 def initialize(name) @log = Logging.logger[name] @log.add_appenders(Logging.appenders.stdout( :layout => Logging.layouts.pattern(:pattern => '%m\n') ) ) end |
Instance Method Details
#debug(message, code = nil) ⇒ Object
16 17 18 19 |
# File 'lib/logging/nutella_logger.rb', line 16 def debug(, code=nil) @log.debug(ANSI.cyan + + ANSI.reset) code end |
#error(message, code = nil) ⇒ Object
36 37 38 39 |
# File 'lib/logging/nutella_logger.rb', line 36 def error(, code=nil) @log.error(ANSI.red + + ANSI.reset) code end |
#info(message, code = nil) ⇒ Object
21 22 23 24 |
# File 'lib/logging/nutella_logger.rb', line 21 def info(, code=nil) @log.info() code end |
#success(message, code = nil) ⇒ Object
26 27 28 29 |
# File 'lib/logging/nutella_logger.rb', line 26 def success(, code=nil) @log.info(ANSI.green + + ANSI.reset) code end |
#warn(message, code = nil) ⇒ Object
31 32 33 34 |
# File 'lib/logging/nutella_logger.rb', line 31 def warn(, code=nil) @log.warn(ANSI.yellow + + ANSI.reset) code end |