File tree Expand file tree Collapse file tree
tns-core-modules/profiling Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -128,3 +128,8 @@ export declare function stopCPUProfile(name: string): void;
128128 * Gets the uptime of the current process in milliseconds.
129129 */
130130export function uptime ( ) : number ;
131+
132+ /**
133+ * Logs important messages. Contrary to console.log's behavior, the profiling log should output even for release builds.
134+ */
135+ export function log ( message : string ) : void ;
Original file line number Diff line number Diff line change @@ -7,6 +7,14 @@ export function uptime() {
77 return global . android ? ( < any > org ) . nativescript . Process . getUpTime ( ) : ( < any > global ) . __tns_uptime ( ) ;
88}
99
10+ export function log ( message : string ) : void {
11+ if ( ( < any > global ) . __nslog ) {
12+ ( < any > global ) . __nslog ( "CONSOLE LOG: " + message ) ;
13+ } else {
14+ console . log ( message ) ;
15+ }
16+ }
17+
1018interface TimerInfo extends TimerInfoDefinition {
1119 totalTime : number ;
1220 lastTime ?: number ;
@@ -285,4 +293,4 @@ export function stopCPUProfile(name: string) {
285293 if ( anyGlobal . android ) {
286294 __stopCPUProfiler ( name ) ;
287295 }
288- }
296+ }
You can’t perform that action at this time.
0 commit comments