Module: Graphiti

Defined in:
lib/graphiti_gql/graphiti_hax.rb

Class Method Summary collapse

Class Method Details

.debug(msg, color = :white, bold = false) ⇒ Object



604
605
606
# File 'lib/graphiti_gql/graphiti_hax.rb', line 604

def self.debug(msg, color = :white, bold = false)
  log(msg, color, bold, level: :debug)
end

.info(msg, color = :white, bold = false) ⇒ Object



608
609
610
# File 'lib/graphiti_gql/graphiti_hax.rb', line 608

def self.info(msg, color = :white, bold = false)
  log(msg, color, bold, level: :info)
end

.log(msg, color = :white, bold = false, level: nil) ⇒ Object



612
613
614
615
616
617
# File 'lib/graphiti_gql/graphiti_hax.rb', line 612

def self.log(msg, color = :white, bold = false, level: nil)
  return unless ::GraphitiGql.config.log
  colored = ActiveSupport::LogSubscriber.new.send(:color, msg, color, bold)
  level ||= :debug
  logger.send(level, colored)
end