mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
updated console logs for iOS
This commit is contained in:
@@ -1,20 +1,25 @@
|
||||
// TODO: we should use Foundation.NSLog() but it currently does not work
|
||||
// TODO: Is there a better way to implement the info/warn/error
|
||||
|
||||
function nslog(prefix: string, message: string)
|
||||
{
|
||||
(<any>Foundation).NSLog("%@: %@", [{ type: PrimitiveType.POINTER, value: prefix }, { type: PrimitiveType.POINTER, value: message}]);
|
||||
}
|
||||
|
||||
export var helper_log = function (message: string) {
|
||||
log('log: ' + message);
|
||||
nslog('log', message);
|
||||
}
|
||||
|
||||
export var info = function (message: string) {
|
||||
log('info: ' + message);
|
||||
nslog('info', message);
|
||||
}
|
||||
|
||||
export var error = function (message: string) {
|
||||
log('error: ' + message);
|
||||
nslog('error', message);
|
||||
}
|
||||
|
||||
export var warn = function (message: string) {
|
||||
log('warning: ' + message);
|
||||
nslog('warning', message);
|
||||
}
|
||||
|
||||
export var timeMillis = function (): number {
|
||||
|
||||
Reference in New Issue
Block a user