Manual:DIL Manual/log()
Jump to navigation
Jump to search
log()
Procedure. Writes a line to the server log.
log(s : string)
Writes s to vme.log (in vme/bin), after the time and the
name of the zone: zone/text. The zone is that of the unit the program runs on,
which for a program on a player is _players. The line is also added to that zone's
.err file in the zone directory (zondir in server.cfg),
and gods who follow the log in the game see it as (LOG: zone/text).
Use it for errors a builder or admin should see, and for tracing a program while writing it. Players never see it.
Parameters
| Name | Type | Meaning |
|---|---|---|
| s | string | The text. |
Notes
vme.logstarts empty at every boot.- The server stops itself when it has written 80 MB of log since boot ("Log-file insanely big! Going down."). Don't log on every tick, every command, or in a loop.
- A null string writes nothing.
Example
dilbegin count_inside(u : unitptr);
var
n : integer;
item : unitptr;
code
{
item := u.inside;
while (item != null)
{
n := n + 1;
item := item.next;
}
if (n > 50)
log(u.symname + " holds " + itoa(n) + " units");
return;
}
dilend
Counts the units in a container and logs it when there are suspiciously many.