Saving trace output to file
Saving trace output to file
on a zone by zone basis, the ability to write all trace output to a specific file would be very handy. certainly not a high priority, but a nice to have item for the wish list.
You have the ability to write to files using _server.writeFile();
writing a trace function would be really simple
It will write to a .log file with the name of the current zone, the message passed as a parameter along with the date and time when the trace was called.
writing a trace function would be really simple
Code: Select all
function traceToFile(text) {
var date = new Date();
// format your date here like for example
yourDate = "30/06/2006 14:30:21";
text = yourDate + " - " +text;
_server.writeFile(_server.getCurrentZone().getName()+".log", text, true);
}
// then you call it like
traceToFile ("some text");
function onJoin(usr) {if (usr.getName() == "Lapo") trace ("All Hail Lapo");}