Sha256: e7efa70c09f7685500976d57ca5fb38453901f78847cdcf7e9a265ec4a9555ff

Contents?: true

Size: 423 Bytes

Versions: 15

Compression:

Stored size: 423 Bytes

Contents

# frozen_string_literal: true

require "logger"

module Bridgetown
  module Rack
    class Logger < Logger
      def self.message_with_prefix(msg)
        return if msg.include?("/_bridgetown/live_reload")

        "\e[35m[Server]\e[0m #{msg}"
      end

      def initialize(*)
        super
        @formatter = proc do |_, _, _, msg|
          self.class.message_with_prefix(msg)
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
bridgetown-core-1.0.0 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.beta3 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.beta2 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.beta1 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.alpha11 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.alpha10 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.alpha9 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.alpha8 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.alpha7 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.alpha6 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.alpha5 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.alpha4 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.alpha3 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.alpha2 lib/bridgetown-core/rack/logger.rb
bridgetown-core-1.0.0.alpha1 lib/bridgetown-core/rack/logger.rb