Browse Source

output traces to native trace() when using -D fdb or -D nativeTrace

Nicolas Cannasse 13 years ago
parent
commit
16d3143863
2 changed files with 6 additions and 0 deletions
  1. 1 0
      doc/CHANGES.txt
  2. 5 0
      std/haxe/Log.hx

+ 1 - 0
doc/CHANGES.txt

@@ -16,6 +16,7 @@
 	all : allowed @:extern on static methods (no generate + no closure + force inlining)
 	all : added documentation in --display infos + display overloads in completion
 	js : removed --js-namespace, added $hxClasses
+	flash : output traces to native trace() when using -D fdb or -D nativeTrace
 
 2011-09-25: 2.08
 	js : added js.JQuery

+ 5 - 0
std/haxe/Log.hx

@@ -28,7 +28,12 @@ class Log {
 
 	public static dynamic function trace( v : Dynamic, ?infos : PosInfos ) : Void {
 		#if flash
+			#if (fdb || nativeTrace)
+		var pstr = infos == null ? "(null)" : pos.fileName+":"+pos.lineNumber;
+		untyped __global__["trace"](pstr+": "+flash.Boot.__string_rec(v,""));
+			#else
 		untyped flash.Boot.__trace(v,infos);
+			#end
 		#elseif neko
 		untyped __dollar__print(infos.fileName+":"+infos.lineNumber+": ",v,"\n");
 		#elseif js