Prev | Current Page 348 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

Log.trace
function can accept a number of other parameters, while the standard trace function usually only
expects one parameter: the string you want to output.
The haxe.Log class is the main proxy for the trace features in each platform supported by haXe. If you
want more control over the output of your trace functionality, then the haxe.Log class is the way to
apply it. Table 7 - 1 lists the functions provided by the haxe.Log class.
Table 7 - 1
haXe.Log Method Platforms
trace( val : Dynamic, pos : haxe.PosInfos ) : Void Flash, JS, and Neko
clear() : Void Flash, JS, and Neko
setColor( color : Int ) : Void Flash only
haxe.Log.trace()
As mentioned previously, this version of the haXe trace function provides more control over the
output. There are typically two ways that this can be done; one way is to pass the function a secondary
argument in the shape of an object derived from the haxe.PosInfos typedef, while the other route
182
Part I: The Core Language
involves supplying a new function mapping the existing trace function signature and facilitating the
functionality required by your application.


Pages:
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360