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



866
867
868
869
870
871
872
# File 'lib/kitchen/logger.rb', line 866

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



899
900
901
902
903
904
905
# File 'lib/kitchen/logger.rb', line 899

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



910
911
912
913
914
915
916
# File 'lib/kitchen/logger.rb', line 910

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



877
878
879
880
881
882
883
# File 'lib/kitchen/logger.rb', line 877

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



921
922
923
924
925
926
927
# File 'lib/kitchen/logger.rb', line 921

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



888
889
890
891
892
893
894
# File 'lib/kitchen/logger.rb', line 888

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