I'm trying to create an overload for console.log() but my function does not process strings like console.log can,
for example, this is working:
console.log("variableName = %s", variableName);
However, it breaks my overloaded function which calls console.log() with a message as the string:
function consoleLog(message) {
consoleMessageLogger(message, LOG_TYPE_LOG);
}
I'm aware that I could use a new syntax like this:
consoleLog(`variableName: ${variableName}`);
However I'm trying to make it work the old way as well - like this:
consoleLog("variableName = %s", variableName); // my overloaded function
I assume the solution involves ... and arguments (IArguments), but I'm not sure how to use it exactly, also it would be nice if I can find some code that already handles all available types - like "%s", "%d", etc.