Sha256: 7748aefc3b25b6dd7d58fde80333f6ab008b11c2e50fa067d6e38d8a371b77d7

Contents?: true

Size: 393 Bytes

Versions: 10

Compression:

Stored size: 393 Bytes

Contents

module LogSanity
  module LogSubscriber
    class Base < ::ActiveSupport::LogSubscriber

      private
      delegate :fields, :log, to: LogSanity

      def event_start(event)
        if event.time.is_a? Float
          # convert event's monotonic start .time to a Time
          Time.current - event.duration/1000.0
        else
          event.time
        end
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
log_sanity-2.3.0 lib/log_sanity/log_subscribers/base.rb
log_sanity-2.2.0 lib/log_sanity/log_subscribers/base.rb
log_sanity-2.1.2 lib/log_sanity/log_subscribers/base.rb
log_sanity-2.1.1 lib/log_sanity/log_subscribers/base.rb
log_sanity-2.1.0 lib/log_sanity/log_subscribers/base.rb
log_sanity-2.0.0 lib/log_sanity/log_subscribers/base.rb
log_sanity-1.3.2 lib/log_sanity/log_subscribers/base.rb
log_sanity-1.3.1 lib/log_sanity/log_subscribers/base.rb
log_sanity-1.3.0 lib/log_sanity/log_subscribers/base.rb
log_sanity-1.2.0 lib/log_sanity/log_subscribers/base.rb