[log] add AndroidLog

This commit is contained in:
2019-08-23 14:38:27 +03:00
parent f31b1ce506
commit 7a68604cad
2 changed files with 18 additions and 1 deletions

View File

@@ -0,0 +1,15 @@
package haxework.log;
import cpp.VarArg;
import haxe.extern.Rest;
import cpp.ConstCharStar;
@:include("android/log.h")
extern class AndroidLog {
@:native("__android_log_print")
public static function print(prio:Int, tag:ConstCharStar, fmt:ConstCharStar, rest:Rest<VarArg>):Void;
@:native("__android_log_write")
public static function write(prio:Int, tag:ConstCharStar, message:ConstCharStar):Void;
}

View File

@@ -28,6 +28,8 @@ class TraceLogger extends BaseLogger {
}
#elseif js
untyped js.Boot.__trace(v, infos);
#elseif android
haxework.log.AndroidLog.write(3, "", ConstCharStar.fromString(Std.string(v)));
#elseif (php && php7)
php.Boot.trace(v);
#elseif php