Sha256: 4154b3b59e5e85a3e7466bbdecdf3523caf4917ff70eca5b9c86d51a757be307

Contents?: true

Size: 375 Bytes

Versions: 13

Compression:

Stored size: 375 Bytes

Contents

require 'logger'

module Puppeteer::DebugPrint
  if ['1', 'true'].include?(ENV['DEBUG'])
    def debug_puts(*args, **kwargs)
      @__debug_logger ||= Logger.new(STDOUT)
      @__debug_logger.debug(*args, **kwargs)
    end

    def debug_print(*args)
      print(*args)
    end
  else
    def debug_puts(*args, **kwargs)
    end

    def debug_print(*args)
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
puppeteer-ruby-0.0.16 lib/puppeteer/debug_print.rb
puppeteer-ruby-0.0.15 lib/puppeteer/debug_print.rb
puppeteer-ruby-0.0.14 lib/puppeteer/debug_print.rb
puppeteer-ruby-0.0.13 lib/puppeteer/debug_print.rb
puppeteer-ruby-0.0.12 lib/puppeteer/debug_print.rb
puppeteer-ruby-0.0.11 lib/puppeteer/debug_print.rb
puppeteer-ruby-0.0.10 lib/puppeteer/debug_print.rb
puppeteer-ruby-0.0.9 lib/puppeteer/debug_print.rb
puppeteer-ruby-0.0.8 lib/puppeteer/debug_print.rb
puppeteer-ruby-0.0.6 lib/puppeteer/debug_print.rb
puppeteer-ruby-0.0.5 lib/puppeteer/debug_print.rb
puppeteer-ruby-0.0.4 lib/puppeteer/debug_print.rb
puppeteer-ruby-0.0.3 lib/puppeteer/debug_print.rb