Skip to content

A iOS PhoneGap Plugin which functions as a bridge between console.log to NSLog

Notifications You must be signed in to change notification settings

logicaroma/RMConsoleLogger

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RMConsoleLogger

A iOS PhoneGap Plugin which functions as a bridge between console.log to NSLog

#How to setup:

  • create a new file named rmnzr.console.log.js in www/plugins/
  • copy & paste :

var RMLogger = { //Phonegap.exec(successCallback, failCallback, pluginName, action, [args]). log: function(level, message) {

    return Cordova.exec(null, null, "com.rmnzr.console", "log", message);
}

};

  • Add a new entry to Plugins dictionary in Cordova.plist: Key: com.rmnzr.console Value: RMConsoleLogger

#Usage:

// Somewhere in your js (after deviceready event fired)
RMLogger.log("log", ["Hey", {l:'hello',k:'world'}]); 

##Outputs: key: l value: hello key: k value: world argument atIndex 0: value: Hey

#Customize: To disable pretty printing the output comment out this line: #define RM_PRETTY_PRINT_ON

About

A iOS PhoneGap Plugin which functions as a bridge between console.log to NSLog

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published