lib/kitchen/logger.rb
# Construct a new standard out logger.
#
# @param stdout [IO] the IO object that represents stdout (or similar)
# @param color [Symbol] color to use when outputing messages
# @return [StdoutLogger] a new logger
# @api private
Construct a new standard out logger.
Construct a new standard out logger .
def stdout_logger(stdout, color)
      logger = StdoutLogger.new(stdout)
      if Kitchen.tty?
        logger.formatter = proc do |_severity, _datetime, _progname, msg|
          Color.colorize("#{msg}", color).concat("\n")
        end
      else
        logger.formatter = proc do |_severity, _datetime, _progname, msg|
          msg.concat("\n")
        end
      end
      logger
    end
def stdout_logger ( stdout , color ) logger = StdoutLogger . new ( stdout ) if Kitchen . tty? logger . formatter = proc do | _severity , _datetime , _progname , msg | Color . colorize ( "#{msg}" , color ) . concat ( "\n" ) end else logger . formatter = proc do | _severity , _datetime , _progname , msg | msg . concat ( "\n" ) end end logger end
Construct a new standard out logger.
Construct a new standard out logger .
a new logger
a new logger
StdoutLogger
stdout
the IO object that represents stdout (or similar)
the IO object that represents stdout ( or similar )
color
color to use when outputing messages
color to use when outputing messages
api
None