Sha256: f39ce6ac6cd7e4aa7e8dfae528d5fd0cb6e14115314674e6c93c6decda60a5a3

Contents?: true

Size: 384 Bytes

Versions: 1

Compression:

Stored size: 384 Bytes

Contents

require "logger"
require "colored"

module CourseraDownloader
  class LogFormatter < ::Logger::Formatter
    def call(severity, time, progname, msg)
      case severity
      when "INFO"
        severity = severity.green
      when "WARN"
        severity = severity.yellow
      when "ERROR"
        severity = severity.red
      end

      "#{severity}: #{msg}\n"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
coursera_downloader-1.0.0 lib/coursera_downloader/log_formatter.rb