Sha256: 8f418d368bec859eb3ccde595452df7db45ba1cc53a27ad0600d3f38188a0e11

Contents?: true

Size: 280 Bytes

Versions: 1

Compression:

Stored size: 280 Bytes

Contents

require 'mysql2_query_filter'

module Mysql2QueryFilter::Plugin
  class Log < Filter
    Mysql2QueryFilter.register(:log, self)

    def initialize(options)
      super
      @out = @options[:out] || $stderr
    end

    def filter(sql)
      @out << "#{sql}\n"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mysql2_query_filter-plugin-log-0.0.3 lib/mysql2_query_filter/plugin/log.rb