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



825
826
827
828
829
830
831
# File 'lib/kitchen/logger.rb', line 825

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



858
859
860
861
862
863
864
# File 'lib/kitchen/logger.rb', line 858

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



869
870
871
872
873
874
875
# File 'lib/kitchen/logger.rb', line 869

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



836
837
838
839
840
841
842
# File 'lib/kitchen/logger.rb', line 836

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



880
881
882
883
884
885
886
# File 'lib/kitchen/logger.rb', line 880

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



847
848
849
850
851
852
853
# File 'lib/kitchen/logger.rb', line 847

def warn(msg = nil, &block)
  if block
    super(nil) { "$$$$$$ #{block.call}" }
  else
    super("$$$$$$ #{msg}")
  end
end