Sha256: 576a2da3f306480f536531bf0120b6824036461357807bb2ee0c3d1e6341f0c2

Contents?: true

Size: 572 Bytes

Versions: 3

Compression:

Stored size: 572 Bytes

Contents

require "platina_world/loggers/base"

module PlatinaWorld
  module Loggers
    class FileStatus < Base
      private

      def formatter_class
        PlatinaWorld::Loggers::FileFormatter
      end
    end

    class FileFormatter
      def call(severity, time, program_name, message)
        file_format(severity) % message
      end

      def file_format(severity)
        case severity
        when "INFO"
          "      \e[32m%{action}\e[0m  %{path}\n"
        when "ERROR"
          "      \e[31m%{action}\e[0m  %{path}\n"
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
platina_world-0.1.2.1 lib/platina_world/loggers/file_status.rb
platina_world-0.1.2 lib/platina_world/loggers/file_status.rb
platina_world-0.1.1 lib/platina_world/loggers/file_status.rb