Class: Kitchen::Logger::StdoutLogger
- Inherits:
-
LogdevLogger
- Object
- Logger
- LogdevLogger
- Kitchen::Logger::StdoutLogger
- Defined in:
- lib/kitchen/logger.rb
Overview
Internal class which reformats logging methods for display as console output.
Instance Method Summary collapse
-
#debug(msg = nil, &block) ⇒ Object
Log a debug message.
-
#error(msg = nil, &block) ⇒ Object
Log an error message.
-
#fatal(msg = nil, &block) ⇒ Object
Log a fatal message.
-
#info(msg = nil, &block) ⇒ Object
Log an info message.
-
#unknown(msg = nil, &block) ⇒ Object
Log an unknown message.
-
#warn(msg = nil, &block) ⇒ Object
Log a warn message.
Methods inherited from LogdevLogger
Instance Method Details
#debug(msg = nil, &block) ⇒ Object
Log a debug message
691 692 693 694 695 696 697 |
# File 'lib/kitchen/logger.rb', line 691 def debug(msg = nil, &block) if block super(nil) { "D #{block.call}" } else super("D #{msg}") end end |
#error(msg = nil, &block) ⇒ Object
Log an error message
724 725 726 727 728 729 730 |
# File 'lib/kitchen/logger.rb', line 724 def error(msg = nil, &block) if block super(nil) { ">>>>>> #{block.call}" } else super(">>>>>> #{msg}") end end |
#fatal(msg = nil, &block) ⇒ Object
Log a fatal message
735 736 737 738 739 740 741 |
# File 'lib/kitchen/logger.rb', line 735 def fatal(msg = nil, &block) if block super(nil) { "!!!!!! #{block.call}" } else super("!!!!!! #{msg}") end end |
#info(msg = nil, &block) ⇒ Object
Log an info message
702 703 704 705 706 707 708 |
# File 'lib/kitchen/logger.rb', line 702 def info(msg = nil, &block) if block super(nil) { " #{block.call}" } else super(" #{msg}") end end |
#unknown(msg = nil, &block) ⇒ Object
Log an unknown message
746 747 748 749 750 751 752 |
# File 'lib/kitchen/logger.rb', line 746 def unknown(msg = nil, &block) if block super(nil) { "?????? #{block.call}" } else super("?????? #{msg}") end end |
#warn(msg = nil, &block) ⇒ Object
Log a warn message
713 714 715 716 717 718 719 |
# File 'lib/kitchen/logger.rb', line 713 def warn(msg = nil, &block) if block super(nil) { "$$$$$$ #{block.call}" } else super("$$$$$$ #{msg}") end end |