Logger Android check and override
Logger checks the operating system on which it is running to determine whether to use the Android logger. We can override this behavior.
By default, WL.Logger checks the operating system at run time, and if it is running on Android it attempts to use the cordova plug-in. If the plug-in fails, it falls back to console.log. There are several differences between the cordova plug-in logger and console log:
- Cordova plugin logger
- Asynchronous
- Provides better output in LogCat
- Requires that the deviceready event previously fired.
- Console log
- Synchronous
Native logger + LogCat:
console.log + LogCat:
To override the Android check, do one of the these:
- Pass android: false to WL.Logger.config
Logs with WL.Logger.log are treated as verbose by LogCat.
Parent topic: Configure the MobileFirst Logger