Sha256: b261550e5185f4c96371ec37c30b5ec978a48c8c974f7d8c742bb5f972d1dbc8

Contents?: true

Size: 364 Bytes

Versions: 4

Compression:

Stored size: 364 Bytes

Contents

# encoding: UTF-8

def dbg(*args)
  prefix = "#{args.shift} " if [String, Symbol].include?(args.first.class)

  msg = args.map(&:inspect).join(" | ")
  msg = "#{prefix}#{msg}"

  if defined?(Rails::Console) || Rails.env.test? # STDOUT is usually available here
    puts "[DEBUG] #{msg}"
  else
    Rails.logger.tagged("DEBUG") { Rails.logger.debug msg }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
iqvoc-3.5.3 lib/debug.rb
iqvoc-3.5.2 lib/debug.rb
iqvoc-3.5.1 lib/debug.rb
iqvoc-3.5.0 lib/debug.rb