[log] add AndroidLog
This commit is contained in:
15
src/main/haxework/log/AndroidLog.hx
Normal file
15
src/main/haxework/log/AndroidLog.hx
Normal 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;
|
||||||
|
}
|
||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user