Sha256: c5b2e554f316ac7efaf51dffd2c32089e743d0b6ae939c5c1e0cb5d459d2be14

Contents?: true

Size: 262 Bytes

Versions: 77

Compression:

Stored size: 262 Bytes

Contents

require 'logger'

module Kontena
  module Cli
    module LogFormatter
      class StripColor < Logger::Formatter
        def msg2str(msg)
          super(msg.kind_of?(String) ? msg.gsub(/\e+\[{1,2}[0-9;:?]+m/m, '') : msg)
        end
      end
    end
  end
end

Version data entries

77 entries across 77 versions & 2 rubygems

Version Path
krates-1.7.11 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.7.10 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.7.9 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.7.8 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.7.7 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.7.6 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.7.5 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.7.4 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.7.3 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.7.2 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.7.1 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.7.0 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.6.9 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.6.8 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.6.7 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.6.6 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.6.5 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.6.4 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.6.3 lib/kontena/cli/log_formatters/strip_color.rb
krates-1.6.2 lib/kontena/cli/log_formatters/strip_color.rb