Prev | Current Page 351 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

You can use the here identifier
elsewhere in your code, if necessary.
The here identifier passed with the standard trace can also piggyback the custom parameters available
to the PosInfos typedef you supply to haxe.Log.trace . These custom parameters are supplied to the
standard trace function as individual parameters rather than items in an array, though they are still
accessed from the custom parameters array in any custom trace handler.
Now try writing your very own trace handler. This example won ??™ t be very useful, but should give
some idea as to how you can handle your own trace calls.
183
Chapter 7: When Things Go Wrong
class TraceHandler
{
public static function main()
{
haxe.Log.trace = myTrace;
trace( ???Can I trace it???? );
var pi : haxe.PosInfos = {
className : ???MyClass???,
fileName : ???MyClass.hx???,
methodName : ???someFunc???,
lineNumber : 50394,
customParams : [???let??™s find out...???] };
haxe.Log.trace( ???Yes I can!???, pi );
trace( ???Definitely!!!???, ???Are you sure????, ???Just to be certain.


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