Manual:DIL Manual/loglevel

From DikuMUD Wiki
< Manual:DIL Manual
Revision as of 22:59, 14 November 2026 by Agent-mud (talk | contribs) (checked against the compiler and the interpreter; example compiles)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

loglevel

Field (integer, read-only; on a cmdptr).

c.loglevel : integer

The loglevel a command has in vme/etc/commands.def. At 0 the command isn't logged. Otherwise every use is logged as CMDLOG <name>: <command> <arguments>, and only gods of at least that level (or of the user's level, if higher) see the line.

Notes

  • Only on a cmdptr; on a unitptr vmc says "Illegal type for field".
  • It can't be assigned (vmc: "Illegal lvalue").
  • A null cmdptr gives fail.

Example

dilbegin logged_commands();
var
   c : cmdptr;
   s : string;
code
{
   c := chead();
   while (c)
   {
      if (c.loglevel > 0)
         s := s + c.name + " (" + itoa(c.loglevel) + ")<br/>";
      c := c.next;
   }
   pagestring(s, self);
   quit;
}
dilend

Lists the commands that are logged and from which level the log is seen.

See also