Sha256: 416df47684d7834939de127be99458e670a30d68fd5b0120a7a99f6bc7a783ea

Contents?: true

Size: 527 Bytes

Versions: 1

Compression:

Stored size: 527 Bytes

Contents

module Jenkins
  module Peace
    class ConsoleLogger

      RED    = "\e[31m"
      GREEN  = "\e[32m"
      YELLOW = "\e[33m"
      CLEAR  = "\e[0m"

      attr_reader :logger


      def initialize(logger = $stdout)
        @logger = logger
      end


      def info(message)
        logger << "#{GREEN}#{message}#{CLEAR}\n"
      end


      def warn(message)
        logger << "#{YELLOW}#{message}#{CLEAR}\n"
      end


      def error(message)
        logger << "#{RED}#{message}#{CLEAR}\n"
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
jenkins-peace-1.0.0 lib/jenkins/peace/console_logger.rb