File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed
tns-core-modules/profiling Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -128,3 +128,8 @@ export declare function stopCPUProfile(name: string): void;
128
128
* Gets the uptime of the current process in milliseconds.
129
129
*/
130
130
export 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() {
7
7
return global . android ? ( < any > org ) . nativescript . Process . getUpTime ( ) : ( < any > global ) . __tns_uptime ( ) ;
8
8
}
9
9
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
+
10
18
interface TimerInfo extends TimerInfoDefinition {
11
19
totalTime : number ;
12
20
lastTime ?: number ;
@@ -285,4 +293,4 @@ export function stopCPUProfile(name: string) {
285
293
if ( anyGlobal . android ) {
286
294
__stopCPUProfiler ( name ) ;
287
295
}
288
- }
296
+ }
You can’t perform that action at this time.
0 commit comments