Last active
October 25, 2016 18:14
-
-
Save dchersey/4ca2c983602375aedcc121e482236ddc to your computer and use it in GitHub Desktop.
simple development and production logging code for rubymotion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Object | |
def log_error message, object=nil | |
if Device.simulator? | |
mp "ERROR: #{message}" | |
mp object if object | |
else | |
NSLog("ERROR: #{message}: %@\n".to_s, object) | |
end | |
end | |
def log_dev message, object=nil | |
if Device.simulator? | |
puts "LOG: #{message}" | |
mp object if object | |
elsif App.development? || Module.const_defined?(:CRASHLYTICS_BETA) | |
NSLog("XX_LOG: #{message}: %@\n".to_s, object) | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment