Class: Kitchen::Logger::StdoutLogger

Inherits:
LogdevLogger show all
Defined in:
lib/kitchen/logger.rb

Overview

Internal class which reformats logging methods for display as console output.

Instance Method Summary collapse

Methods inherited from LogdevLogger

#<<, #banner

Instance Method Details

#debug(msg = nil, &block) ⇒ Object

Log a debug message

Parameters:

  • msg (String) (defaults to: nil)

    a 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

Parameters:

  • msg (String) (defaults to: nil)

    a 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

Parameters:

  • msg (String) (defaults to: nil)

    a 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

Parameters:

  • msg (String) (defaults to: nil)

    a 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

Parameters:

  • msg (String) (defaults to: nil)

    a 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

Parameters:

  • msg (String) (defaults to: nil)

    a 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