fix(log): Allow passing optional params for logs (#9456)

This commit is contained in:
Juan David Nicholls Cardona
2021-07-06 10:23:37 -05:00
committed by GitHub
parent f6faa4509a
commit 7b800945dd

View File

@@ -6,11 +6,11 @@ export function uptime() {
return global.android ? (<any>org).nativescript.Process.getUpTime() : (<any>global).__tns_uptime();
}
export function log(message: string): void {
export function log(message: string, ...optionalParams: any[]): void {
if ((<any>global).__nslog) {
(<any>global).__nslog('CONSOLE LOG: ' + message);
}
console.log(message);
console.log(message, ...optionalParams);
}
export type InstrumentationMode = 'counters' | 'timeline' | 'lifecycle';