Fix Krom trace on Windows

This commit is contained in:
Lubos Lenco 2017-11-28 22:09:05 +01:00
parent eaf997182f
commit e559c59c3b
2 changed files with 14 additions and 1 deletions

View file

@ -24,6 +24,19 @@ class SpaceArmory extends Trait {
super();
notifyOnInit(init);
#if (sys_krom && !arm_viewport)
// TODO: On Windows Krom does not output to stdout, redirect to stderr..
if (Krom.systemId() == "Windows") {
var haxeTrace = haxe.Log.trace;
function kromTrace(v:Dynamic, ?inf:haxe.PosInfos) {
var str = Std.string(v);
Krom.sysCommand('>&2 echo "$str"');
haxeTrace(v, inf);
}
haxe.Log.trace = kromTrace;
}
#end
}
function init() {

View file

@ -22,7 +22,7 @@ def krom_trace(text):
if len(txt) > 1 and txt[1].startswith('__arm'):
bridge.parse_operator(txt[1])
else:
print_info(text)
print(text)
def print_info(text):
global tag_redraw