_log.c

tmi2_fluffos_v2/lib/cmds/wiz/_log.c · 1.0 KB

From the archive tmi2_fluffos_v2.zip

Download the archive   « Back to the archive contents

/*
// Author (??)
// Help added by Brian (1/28/92)
*/
#include <config.h>
#include <mudlib.h>
 
inherit DAEMON;

int cmd_log(string path) {
 
   seteuid(getuid(previous_object()));
 
   if( path ) path = LOG_DIR + path;
 
   else {
      path = user_path(getuid(this_player()));
      path += "log";
   }
 
   if( !path ) path = LOG_DIR + "/log";
 
   if(!file_exists(path)) {
     notify_fail("Log: " + path + " does not exist.\n");
   return 0; }
 
   write(path+":\n");
 
   if(!tail(path)) {
     notify_fail("Log: Could not read " + path + "\n");
   return 0; }
 
return 1; }

int
help() {
   write("Command: log\nSyntax: log [log | lpmud.log | other]\n"+
      "If no parameter is passed then this command will show\n"+
      "you the end of the log file in your directory.  This is\n"+
      "where errors in your objects code will appear.  If you\n"+
      "pass a filename then it will look for and tail the file\n"+
      "by that name in the /log directory.  log.log and log\n"+
      "lpmud.log contain most of the errors there.\n");
   return 1;
}
/* EOF */

Site Stats

Snippets: 1791
Codebases: 571