Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trace without file name and line number in Haxe

Tags:

haxe

Haxe has trace(), which can be used on all targets to print contents.

trace("aa"); // Main.hx:89: aa

How do I print just the contents, without the file name and line number?

like image 392
thor Avatar asked Dec 26 '13 21:12

thor


1 Answers

For sys targets (eg. neko, php, cpp, java, cs):

Sys.println(message);

For other targets, it depends on how you want to print the trace statement. For example, it can be customised for JS target:

haxe.Log.trace = function(msg, ?pos) js.Browser.window.console.log("trace: " + msg);
trace("ok?"); //will log to the console: trace: ok?
like image 65
Andy Li Avatar answered Oct 01 '22 07:10

Andy Li