Prev | Current Page 355 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"


Here is an example class using haxe.PosInfos , albeit not in a very useful way.
class LogHandler
{
public static function main()
{
log( ???some data??? );
}
public static function log( data : Dynamic, ?i : haxe.PosInfos ) : Void
{
trace( ???logging: ??? + i.methodName + ??? (??? + i.lineNumber + ???) : ??? + data );
}
}
One very handy use for this feature would be if you wanted to provide file - based logging support for a
compiled Neko library, but didn ??™ t want to commandeer the developers trace support or expose your
own code.
clear() and setColor()
The clear and setColor functions are the remaining two static members of the haxe.Log class. Both
relate to the trace output of your applications, though while clear is cross - platform, setColor will
only function for Flash - related output. These functions are quite self - explanatory, and deserve little
attention other than to know that they are at your disposal.
The setColor function affects the color of the text displayed in the output to a TextField .


Pages:
343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367