watson-ruby
watson-ruby copied to clipboard
If input msg is a Hash, use pp to dump it [lib/watson.rb]
filename : lib/watson.rb line # : 46 tag : todo md5 : 86ace81eb3985d24953abc266e49dcdb
# [todo] - If input msg is a Hash, use pp to dump it
# Print only if DEBUG flag of calling class is true OR
# GLOBAL_DEBUG_ON of Watson module (defined above) is true
# AND GLOBAL_DEBUG_OFF of Watson module (Defined above) is false
# Sometimes we call debug_print from a static method (class << self)
# and other times from a class method, and ::DEBUG is accessed differently
# from a class vs object, so lets take care of that
_DEBUG = (self.is_a? Class) ? self::DEBUG : self.class::DEBUG
print "=> #{msg}" if ( (_DEBUG == true || GLOBAL_DEBUG_ON == true) && (GLOBAL_DEBUG_OFF == false))
end
###########################################################
# Perform system check to see if we are able to use unix less for printing