Prev | Current Page 602 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

now().getDate();
var month = Date.now().getMonth();
var year = Date.now().getFullYear();
filename += ???_??? + day + ???_??? + month + ???_??? + year;
}
return filename + ???.txt???;
}
public static function header()
{
return ???\n\n********************???;
}
public static function footer()
{
return ???********************\n???;
}
public static function log( val : String, ?bold : Bool )
{
// create time stamp
var h = Date.now().getHours();
var m = Date.now().getMinutes();
var s = Date.now().getSeconds();
var str = ???\n??? + h + ???:??? + m + ???:??? + s + ??? - ??? + val + ???\n???;
// append highlight if bold = true
if ( bold ) str = header() + str + footer();
// ...
}
}
This should cover much of the basic data requirements. The majority of the code, here, simply outputs
string values useful for configuring how your log data will look. If, for example, you want your log data
to output to XML, it should be relatively trivial to override the header and footer functions to wrap the
data in the required tags.


Pages:
590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614