Sha256: 90bcde8da687dec5286eebca0b27bfb145850b851cf413184446865bc5a58110

Contents?: true

Size: 423 Bytes

Versions: 2

Compression:

Stored size: 423 Bytes

Contents

class SiteHub
  module Logging
    class LogWrapper
      attr_reader :logger

      def initialize logger
        @logger = logger
      end

      def write msg
        if logger.respond_to?(:<<)
          logger << msg
        elsif logger.respond_to?(:write)
          logger.write(msg)
        end
      end

      def == other
        other.is_a?(LogWrapper) && self.logger == other.logger
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sitehub-0.4.2 lib/sitehub/logging/log_wrapper.rb
sitehub-0.4.1 lib/sitehub/logging/log_wrapper.rb