mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 05:18:39 +08:00
console moved from application to globals
This commit is contained in:
@ -1,7 +1,4 @@
|
|||||||
import consoleModule = require("Console/console");
|
require("globals");
|
||||||
|
|
||||||
// TODO: This is put in the global context, is this the preferred approach
|
|
||||||
console = new consoleModule.Console();
|
|
||||||
|
|
||||||
export var onLaunch = function (): any {
|
export var onLaunch = function (): any {
|
||||||
}
|
}
|
||||||
|
@ -278,7 +278,7 @@ export class Console {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public log(message: any, ...formatParams: any[]): void {
|
public log(message: any, ...formatParams: any[]): void {
|
||||||
helperModule.log(this.formatParams.apply(this, arguments));
|
helperModule.helper_log(this.formatParams.apply(this, arguments));
|
||||||
}
|
}
|
||||||
|
|
||||||
public trace(): void {
|
public trace(): void {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
var TAG = 'JS';
|
var TAG = 'JS';
|
||||||
|
|
||||||
export var log = function (message: string) {
|
export var helper_log = function (message: string) {
|
||||||
android.util.Log.v(TAG, message);
|
android.util.Log.v(TAG, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
2
Console/console_helper.d.ts
vendored
2
Console/console_helper.d.ts
vendored
@ -1,4 +1,4 @@
|
|||||||
export declare var log: (message: string) => void;
|
export declare var helper_log: (message: string) => void;
|
||||||
export declare var info: (message: string) => void;
|
export declare var info: (message: string) => void;
|
||||||
export declare var error: (message: string) => void;
|
export declare var error: (message: string) => void;
|
||||||
export declare var warn: (message: string) => void;
|
export declare var warn: (message: string) => void;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// TODO: we should use Foundation.NSLog() but it currently does not work
|
// TODO: we should use Foundation.NSLog() but it currently does not work
|
||||||
// TODO: Is there a better way to implement the info/warn/error
|
// TODO: Is there a better way to implement the info/warn/error
|
||||||
|
|
||||||
export var log = function (message: string) {
|
export var helper_log = function (message: string) {
|
||||||
log('log: ' + message);
|
log('log: ' + message);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
declare var module, setTimeout, clearTimeout, setInterval, clearInterval;
|
declare var setTimeout, clearTimeout, setInterval, clearInterval;
|
||||||
import timer = require("timer/timer");
|
import timer = require("timer/timer");
|
||||||
module.exports = timer;
|
import consoleModule = require("Console/console");
|
||||||
|
|
||||||
setTimeout = timer.setTimeout;
|
setTimeout = timer.setTimeout;
|
||||||
clearTimeout = timer.clearTimeout;
|
clearTimeout = timer.clearTimeout;
|
||||||
setInterval = timer.setInterval;
|
setInterval = timer.setInterval;
|
||||||
clearInterval = timer.clearTimeout;
|
clearInterval = timer.clearTimeout;
|
||||||
|
|
||||||
|
console = new consoleModule.Console();
|
Reference in New Issue
Block a user