mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-17 04:41:36 +08:00
27 lines
751 B
TypeScript
27 lines
751 B
TypeScript
// 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) {
|
|
nslog('log', message);
|
|
}
|
|
|
|
export var info = function (message: string) {
|
|
nslog('info', message);
|
|
}
|
|
|
|
export var error = function (message: string) {
|
|
nslog('error', message);
|
|
}
|
|
|
|
export var warn = function (message: string) {
|
|
nslog('warning', message);
|
|
}
|
|
|
|
export var timeMillis = function (): number {
|
|
return QuartzCore.CACurrentMediaTime() * 1000;
|
|
} |