Page 1 of 1
Saving trace output to file
Posted: 28 Jun 2006, 23:02
by NateDog
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.
Posted: 29 Jun 2006, 06:07
by Virusescu
You have the ability to write to files using _server.writeFile();
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");
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.
Posted: 29 Jun 2006, 06:24
by Lapo
There's also the logger object that can be used to trace debug data to the SFS standard logger, which also saves in the log files.
Check our ServerSide documentation
Posted: 29 Jun 2006, 13:27
by NateDog
yeah - i guess i can go through and do a massive search/replace of "trace(" to "traceToFile(" ... i was just looking for a lazy solution
*goes to read about logging object*