Re: Logging commands

From: Kras Kresh (
Date: 04/30/02

>From: Scott Trevett <tater@NMT.EDU>
>Subject: [CIRCLE] Logging commands
>Date: Tue, 30 Apr 2002 13:58:37 -0600
>I am trying to write a function that logs to a new log file.  I was
>wondering how the code parses the different log messages into the
>appropriate log commands with the "(GC)" flag are logged to
>the godcmds file

Stock Circle puts the different log messages into the appropriate files
during your mud's bootup. It reads through the syslog file once for every
log file and looks for the exact phrase ie "(GC)". Read your autorun script.

For logging into another file, simply use the following or something

void logfunction(char *str)
  FILE *fl = fopen("logfile", "a");
  fprintf(fl, "%s", str);

"a" stands for append I believe. The above will just append your "str" to
the end of the log file.
For more information for what the second argument for fopen is for, use "man
fopen" on your system.
"logfile" is your second log file other than syslog.

If what you wanted was to do exactly as Circle already has it except you
want it to do it during game play, get rid of the fgrep's in your autorun
script. In your basic_mud_vlog function in utils.c, you will have to parse
the string with the arguments already set into it. Then decide where to
write it. If your circlemud version is older, do it in basic_mud_log

Send and receive Hotmail on your mobile device:

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT