I'm writing a logger module for a Kony app to print out debugging statements. The Kony SDK already has a kony.print
function but I'd like this logger to print out the application's name as a prefix to each statement, to get something like:
FooApp: x is 1
FooApp: a is ["hello", "world"]
The point here is to make it easier for me to filter/find my debug statements in the Xcode or Android Studio logs while debugging.
So I'm aiming to write something like:
var Logger = (function(){
var prefix = ""; //kony.getAppId()?
return{
print: function(message){
kony.print(`${prefix}: ${message}`);
}
};
})();
So the question is whether there is anything like a kony.getAppId()
function, a constant or equivalent I can query to get the appropriate value for prefix
in order to make the module reusable, rather than hard-code it for every project.