Merge branch 'master' of bitbucket.org:shmyga/haxework

This commit is contained in:
2019-09-09 21:46:03 +03:00
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

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