# Patch name: BigLogger # Patch version: # Author's name: David Cheatham # Author's email: david@mush.cx # Version of PennMUSH: 1.7.3p3 # Date patch made: Tue Jul 18 09:13:56 EDT 2000 # Author is willing to support (yes/no): yes # Patch format: Context # # # This is a contributed PennMUSH patch. Its use is subject to the # same restrictions found in PennMUSH's hdrs/copyrite.h file. # # No warranty is given for this patch. It is not necessarily going # to work on your system, with any version of PennMUSH other than # the one above, etc. # # If the author given above was willing to support the patch, you # should write to the author if you have any questions or problems. Do # *NOT* send email messages to Javelin or any PennMUSH mailing list about # this patch! # # Below this line is the author's description of the patch, # followed by the patch itself. If the patch is in context diff # format, you'll probably apply it by typing: patch < patchfile # in your top-level MUSH directory, unless instructed otherwise # below. # # This is a logging patch. It adds lots of neat options. # It lets you: # Log using filenames in mush.cnf... # Log to syslog... # Log to channels... # # And that's it. # Oh, and it loads the config file a bit earlier in startup. # Also, you can use do_log() without the logfiles being open. *** /usr/local/mu/pennmush/src/access.c Mon Jul 17 10:59:52 2000 --- src/access.c Tue Jul 18 09:07:46 2000 *************** *** 189,195 **** #endif fp = fopen(ACCESS_FILE, "r"); if (!fp) { ! do_log(LT_ERR, GOD, GOD, "No %s file found.", ACCESS_FILE); retval = 0; } else { fgets(buf, BUFFER_LEN, fp); --- 189,195 ---- #endif fp = fopen(ACCESS_FILE, "r"); if (!fp) { ! do_rawlog(LT_ERR, "No %s file found.", ACCESS_FILE); retval = 0; } else { fgets(buf, BUFFER_LEN, fp); *************** *** 226,232 **** } if (!add_access_node(buf, who, can, cant, comment)) { /* Something very bad happened */ ! do_log(LT_ERR, GOD, GOD, "Failed to add access node!"); fclose(fp); retval = 0; } --- 226,232 ---- } if (!add_access_node(buf, who, can, cant, comment)) { /* Something very bad happened */ ! do_rawlog(LT_ERR, "Failed to add access node!"); fclose(fp); retval = 0; } *************** *** 258,264 **** #endif fp = fopen(tmpf, "w"); if (!fp) { ! do_log(LT_ERR, GOD, GOD, "Unable to open %s.", tmpf); } else { for (ap = access_top; ap; ap = ap->next) { if (strcmp(ap->host, "@sitelock") == 0) { --- 258,264 ---- #endif fp = fopen(tmpf, "w"); if (!fp) { ! do_rawlog(LT_ERR, "Unable to open %s.", tmpf); } else { for (ap = access_top; ap; ap = ap->next) { if (strcmp(ap->host, "@sitelock") == 0) { *************** *** 546,552 **** if (GoodObject(player)) notify(player, tprintf("Unknown access option: %s", w)); else ! do_log(LT_ERR, GOD, GOD, "Unknown access flag: %s", w); } else { totalfound += found; } --- 546,552 ---- if (GoodObject(player)) notify(player, tprintf("Unknown access option: %s", w)); else ! do_rawlog(LT_ERR, "Unknown access flag: %s", w); } else { totalfound += found; } *** /usr/local/mu/pennmush/src/atr_tab.c Mon Jul 17 10:59:52 2000 --- src/atr_tab.c Tue Jul 18 09:07:46 2000 *************** *** 161,168 **** if ((ap = aname_hash_lookup(aliasp->realname)) != NULL) hashadd(aliasp->alias, (void *) ap, &htab_attrib); else ! fprintf(stderr, ! "ATR INIT: attribute alias %s matches no known attribute.\n", aliasp->alias); } } --- 161,168 ---- if ((ap = aname_hash_lookup(aliasp->realname)) != NULL) hashadd(aliasp->alias, (void *) ap, &htab_attrib); else ! do_rawlog(LT_ERR, ! "ATR INIT: attribute alias %s matches no known attribute.", aliasp->alias); } } *************** *** 200,206 **** ap = (ATTR *) mush_malloc(sizeof(ATTR), "ATTR"); if (!ap) { notify(player, "Critical memory failure - Alert God!"); ! do_log(LT_ERR, 0, 0, "do_attribute_access: unable to malloc ATTR"); return; } AL_NAME(ap) = strdup(name); --- 200,206 ---- ap = (ATTR *) mush_malloc(sizeof(ATTR), "ATTR"); if (!ap) { notify(player, "Critical memory failure - Alert God!"); ! do_rawlog(LT_ERR, "do_attribute_access: unable to malloc ATTR"); return; } AL_NAME(ap) = strdup(name); *** /usr/local/mu/pennmush/src/attrib.c Mon Jul 17 10:59:52 2000 --- src/attrib.c Tue Jul 18 09:07:46 2000 *************** *** 736,744 **** result[1] = 'A' + (oldatr - 100) % 26; return result; } else { ! fprintf(stderr, ! "ERROR: Invalid attribute number in convert_atr. aborting.\n"); ! fflush(stderr); abort(); } } --- 736,743 ---- result[1] = 'A' + (oldatr - 100) % 26; return result; } else { ! do_rawlog(LT_ERR, ! "ERROR: Invalid attribute number in convert_atr. aborting."); abort(); } } *** /usr/local/mu/pennmush/src/boolexp.c Mon Jul 17 10:59:52 2000 --- src/boolexp.c Tue Jul 18 09:07:46 2000 *************** *** 131,143 **** strcpy(tbuf1, uncompress(b->atr_lock->text)); return check_attrib_lock(player, target, b->atr_lock->name, tbuf1); default: ! do_log(LT_ERR, 0, 0, "Bad boolexp type %d in object #%d", b->type, b->thing); report(); return 0; } /* switch */ /* should never be reached */ ! do_log(LT_ERR, 0, 0, "Broken lock type %s in object called by #%d", ltype, player); return 0; } /* else */ --- 131,143 ---- strcpy(tbuf1, uncompress(b->atr_lock->text)); return check_attrib_lock(player, target, b->atr_lock->name, tbuf1); default: ! do_rawlog(LT_ERR, "Bad boolexp type %d in object #%d", b->type, b->thing); report(); return 0; } /* switch */ /* should never be reached */ ! do_rawlog(LT_ERR, "Broken lock type %s in object called by #%d", ltype, player); return 0; } /* else */ *** /usr/local/mu/pennmush/src/bsd.c Mon Jul 17 10:59:52 2000 --- src/bsd.c Tue Jul 18 09:09:07 2000 *************** *** 171,177 **** cf_downmotd_msg[BUFFER_LEN], cf_fullmotd_msg[BUFFER_LEN]; static char poll_msg[DOING_LEN]; char confname[BUFFER_LEN]; - char errlog[BUFFER_LEN]; struct text_block { int nchars; --- 171,176 ---- *************** *** 380,386 **** void kill_info_slave _((void)); #endif extern void local_shutdown _((void)); - void reopen_logs _((void)); void dump_reboot_db _((void)); void load_reboot_db _((void)); --- 379,384 ---- *************** *** 479,491 **** PMInitialize(); #endif - #ifndef macintosh /* read the configuration file */ ! if (argc < 3) { ! fprintf(stderr, "ERROR: Usage: %s config_file error_log_file\n", argv[0]); ! exit(2); ! } ! #endif #ifdef WIN32 { --- 477,489 ---- PMInitialize(); #endif /* read the configuration file */ ! if (argc < 2) ! strncpy(confname, "mush.cnf", BUFFER_LEN - 1); ! else ! strncpy(confname, argv[1], BUFFER_LEN - 1); ! ! confname[BUFFER_LEN - 1] = '\0'; #ifdef WIN32 { *************** *** 537,561 **** fprintf(stderr, "Failed to set locale from environment.\n"); #endif - /* open the log files */ - #ifndef macintosh - strncpy(errlog, argv[2], BUFFER_LEN - 1); - errlog[BUFFER_LEN - 1] = '\0'; - newerr = fopen(errlog, "a"); - if (!newerr) { - fprintf(stderr, "Unable to open %s. Error output to stderr.\n", errlog); - } else { - fprintf(stderr, "Redirecting output to: %s\n", errlog); - if (!freopen(errlog, "a", stderr)) { - printf("Ack! Failed reopening stderr!"); - exit(1); - } - setvbuf(stderr, NULL, _IOLBF, BUFSIZ); - fclose(newerr); - } - #endif - - start_all_logs(); /* this writes a file used by the restart script to check for active mush */ #ifdef AUTORESTART --- 535,540 ---- *************** *** 564,577 **** fclose(id); #endif ! #ifdef macintosh ! strncpy(confname, "mush.cnf", BUFFER_LEN - 1); ! #else ! strncpy(confname, argv[1], BUFFER_LEN - 1); ! #endif ! confname[BUFFER_LEN - 1] = '\0'; init_game_config(confname); #ifdef INFO_SLAVE make_info_slave(); #endif --- 543,554 ---- fclose(id); #endif ! start_errlog(); ! init_game_config(confname); + start_all_logs(); + #ifdef INFO_SLAVE make_info_slave(); #endif *************** *** 594,600 **** init_process_expression(); if (init_game_dbs() < 0) { ! fprintf(stderr, "ERROR: Couldn't load databases! Exiting.\n"); exit(2); } set_signals(); --- 571,577 ---- init_process_expression(); if (init_game_dbs() < 0) { ! do_rawlog(LT_PANIC, "ERROR: Couldn't load databases! Exiting."); exit(2); } set_signals(); *************** *** 665,671 **** WSACleanup(); /* clean up */ exit(1); } ! fprintf(stderr, "Listening (NT-style) on port %d\n", TINYPORT); } #endif /* NT_TCP */ --- 642,648 ---- WSACleanup(); /* clean up */ exit(1); } ! do_rawlog(LT_NOTICE, "Listening (NT-style) on port %d", TINYPORT); } #endif /* NT_TCP */ *************** *** 703,709 **** #ifdef CSRI_TRACE mal_dumpleaktrace(stderr); #endif - fflush(stderr); #endif #ifdef WIN32 --- 680,685 ---- *************** *** 715,722 **** rusage_stats(); #endif /* HAS_RUSAGE */ ! fprintf(stderr, "\nMUSH shutdown completed.\n"); ! fflush(stderr); #ifdef NT_TCP --- 691,697 ---- rusage_stats(); #endif /* HAS_RUSAGE */ ! do_rawlog(LT_NOTICE, "\nMUSH shutdown completed."); #ifdef NT_TCP *************** *** 736,763 **** } #endif /* BOOLEXP_DEBUGGING */ - /* Close and reopen the logfiles - called on SIGHUP */ - void - reopen_logs() - { - FILE *newerr; - /* close up the log files */ - end_all_logs(); - newerr = fopen(errlog, "a"); - if (!newerr) { - fprintf(stderr, - "Unable to open %s. Error output continues to stderr.\n", errlog); - } else { - if (!freopen(errlog, "a", stderr)) { - printf("Ack! Failed reopening stderr!"); - exit(1); - } - setvbuf(stderr, NULL, _IOLBF, BUFSIZ); - fclose(newerr); - } - start_all_logs(); - } - void set_signals() { --- 711,716 ---- *************** *** 1720,1728 **** #endif /* done. print message to the log */ ! fprintf(stderr, "%d file descriptors available.\n", avail_descriptors); ! fprintf(stderr, "RESTART FINISHED.\n"); ! fflush(stderr); while (shutdown_flag == 0) { #ifdef WIN32 GetSystemTime(&win_time); --- 1673,1680 ---- #endif /* done. print message to the log */ ! do_rawlog(LT_NOTICE, "%d file descriptors available.", avail_descriptors); ! do_rawlog(LT_NOTICE, "RESTART FINISHED."); while (shutdown_flag == 0) { #ifdef WIN32 GetSystemTime(&win_time); *************** *** 1737,1743 **** if (signal_shutdown_flag) { flag_broadcast(0, 0, "GAME: Shutdown by external signal"); ! do_rawlog(LT_ERR, "SHUTDOWN by external signal"); #ifdef AUTORESTART system("touch NORESTART"); #endif --- 1689,1695 ---- if (signal_shutdown_flag) { flag_broadcast(0, 0, "GAME: Shutdown by external signal"); ! do_rawlog(LT_NOTICE, "SHUTDOWN by external signal"); #ifdef AUTORESTART system("touch NORESTART"); #endif *************** *** 1939,1945 **** safe_str((char *) hostname_convert(addr.sin_addr), tbuf1, &bp); *bp = '\0'; if (Forbidden_Site(tbuf1) || Forbidden_Site(tbuf2)) { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Refused connection (remote port %d)", newsock, tbuf1, tbuf2, ntohs(addr.sin_port)); shutdown(newsock, 2); closesocket(newsock); --- 1891,1897 ---- safe_str((char *) hostname_convert(addr.sin_addr), tbuf1, &bp); *bp = '\0'; if (Forbidden_Site(tbuf1) || Forbidden_Site(tbuf2)) { ! do_rawlog(LT_CONN, "[%d/%s/%s] Refused connection (remote port %d)", newsock, tbuf1, tbuf2, ntohs(addr.sin_port)); shutdown(newsock, 2); closesocket(newsock); *************** *** 1948,1954 **** #endif return 0; } ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Connection opened.", newsock, tbuf1, tbuf2); return initializesock(newsock, tbuf1, tbuf2); } --- 1900,1906 ---- #endif return 0; } ! do_rawlog(LT_CONN, "[%d/%s/%s] Connection opened.", newsock, tbuf1, tbuf2); return initializesock(newsock, tbuf1, tbuf2); } *************** *** 2009,2015 **** /* Read the text file into a new chain */ close(reserved); if ((fd = open(filename, O_RDONLY, 0)) == -1) { ! do_log(LT_ERR, 0, 0, "couldn't open cached text file '%s'", filename); reserved = open("/dev/null", O_RDWR); return -1; } --- 1961,1967 ---- /* Read the text file into a new chain */ close(reserved); if ((fd = open(filename, O_RDONLY, 0)) == -1) { ! do_rawlog(LT_ERR, "couldn't open cached text file '%s'", filename); reserved = open("/dev/null", O_RDWR); return -1; } *************** *** 2120,2126 **** { if (d->connected) { fcache_dump(d, options.quit_fcache); ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Logout by %s(#%d) ", d->descriptor, d->addr, d->ip, Name(d->player), d->player); announce_disconnect(d->player); --- 2072,2078 ---- { if (d->connected) { fcache_dump(d, options.quit_fcache); ! do_rawlog(LT_CONN, "[%d/%s/%s] Logout by %s(#%d) ", d->descriptor, d->addr, d->ip, Name(d->player), d->player); announce_disconnect(d->player); *************** *** 2131,2142 **** login_number--; if (!under_limit && (login_number < MAX_LOGINS)) { under_limit = 1; ! do_log(LT_CONN, 0, 0, "Below maximum player limit of %d. Logins enabled.", MAX_LOGINS); } } } else { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Logout, never connected. ", d->descriptor, d->addr, d->ip); } --- 2083,2094 ---- login_number--; if (!under_limit && (login_number < MAX_LOGINS)) { under_limit = 1; ! do_rawlog(LT_CONN, "Below maximum player limit of %d. Logins enabled.", MAX_LOGINS); } } } else { ! do_rawlog(LT_CONN, "[%d/%s/%s] Logout, never connected. ", d->descriptor, d->addr, d->ip); } *************** *** 2179,2185 **** #endif if (d->connected) { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Logout by %s(#%d)", d->descriptor, d->addr, d->ip, Name(d->player), d->player); if (d->connected != 2) { fcache_dump(d, options.quit_fcache); --- 2131,2137 ---- #endif if (d->connected) { ! do_rawlog(LT_CONN, "[%d/%s/%s] Logout by %s(#%d)", d->descriptor, d->addr, d->ip, Name(d->player), d->player); if (d->connected != 2) { fcache_dump(d, options.quit_fcache); *************** *** 2193,2204 **** login_number--; if (!under_limit && (login_number < MAX_LOGINS)) { under_limit = 1; ! do_log(LT_CONN, 0, 0, "Below maximum player limit of %d. Logins enabled.", MAX_LOGINS); } } } else { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Connection closed, never connected.", d->descriptor, d->addr, d->ip); } process_output(d); --- 2145,2156 ---- login_number--; if (!under_limit && (login_number < MAX_LOGINS)) { under_limit = 1; ! do_rawlog(LT_CONN, "Below maximum player limit of %d. Logins enabled.", MAX_LOGINS); } } } else { ! do_rawlog(LT_CONN, "[%d/%s/%s] Connection closed, never connected.", d->descriptor, d->addr, d->ip); } process_output(d); *************** *** 2366,2372 **** closesocket(s); exit(4); } ! fprintf(stderr, "Listening on port %d\n", port); listen(s, 5); return s; } --- 2318,2324 ---- closesocket(s); exit(4); } ! do_rawlog(LT_NOTICE, "Listening on port %d", port); listen(s, 5); return s; } *************** *** 2420,2426 **** if (child) { info_slave_state = 1; info_slave_pid = child; ! do_rawlog(LT_ERR, "Spawning info slave on port %d, pid %d, ident %d", ntohs(addr.sin_port), child, USE_IDENT); } else { sprintf(num, "%d", ntohs(addr.sin_port)); --- 2372,2378 ---- if (child) { info_slave_state = 1; info_slave_pid = child; ! do_rawlog(LT_NOTICE, "Spawning info slave on port %d, pid %d, ident %d", ntohs(addr.sin_port), child, USE_IDENT); } else { sprintf(num, "%d", ntohs(addr.sin_port)); *************** *** 2461,2467 **** make_nonblocking(info_slave); /* Do authentication here, if we care */ info_slave_state = 2; ! do_rawlog(LT_ERR, "Accepted info slave from port %d", ntohs(addr.sin_port)); for (j = 0; j < maxd; j++) if (FD_ISSET(j, &info_pending)) query_info_slave(j); --- 2413,2419 ---- make_nonblocking(info_slave); /* Do authentication here, if we care */ info_slave_state = 2; ! do_rawlog(LT_NOTICE, "Accepted info slave from port %d", ntohs(addr.sin_port)); for (j = 0; j < maxd; j++) if (FD_ISSET(j, &info_pending)) query_info_slave(j); *************** *** 2506,2512 **** safe_str((char *) hostname_convert(addr.sin_addr), tbuf2, &bp); *bp = '\0'; if (Forbidden_Site(tbuf1) || Forbidden_Site(tbuf2)) { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Refused connection (remote port %d)", fd, tbuf2, tbuf1, ntohs(addr.sin_port)); shutdown(fd, 2); closesocket(fd); --- 2458,2464 ---- safe_str((char *) hostname_convert(addr.sin_addr), tbuf2, &bp); *bp = '\0'; if (Forbidden_Site(tbuf1) || Forbidden_Site(tbuf2)) { ! do_rawlog(LT_CONN, "[%d/%s/%s] Refused connection (remote port %d)", fd, tbuf2, tbuf1, ntohs(addr.sin_port)); shutdown(fd, 2); closesocket(fd); *************** *** 2651,2657 **** /* Oops, just deal with buf */ } if (Forbidden_Site(buf) || (bp && Forbidden_Site(bp))) { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Refused connection.", fd, bp ? bp : "", buf); shutdown(fd, 2); closesocket(fd); --- 2603,2609 ---- /* Oops, just deal with buf */ } if (Forbidden_Site(buf) || (bp && Forbidden_Site(bp))) { ! do_rawlog(LT_CONN, "[%d/%s/%s] Refused connection.", fd, bp ? bp : "", buf); shutdown(fd, 2); closesocket(fd); *************** *** 2660,2666 **** #endif return; } ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Connection opened.", fd, bp ? bp : "", buf); (void) initializesock(fd, bp ? bp : buf, buf); } --- 2612,2618 ---- #endif return; } ! do_rawlog(LT_CONN, "[%d/%s/%s] Connection opened.", fd, bp ? bp : "", buf); (void) initializesock(fd, bp ? bp : buf, buf); } *************** *** 2739,2745 **** really_flushed += p->nchars; q->head = p->nxt; #ifdef DEBUG ! fprintf(stderr, "free_text_block(0x%x) at 1.\n", p); #endif /* DEBUG */ free_text_block(p); } --- 2691,2697 ---- really_flushed += p->nchars; q->head = p->nxt; #ifdef DEBUG ! do_rawlog(LT_DEBUG, "free_text_block(0x%x) at 1.", p); #endif /* DEBUG */ free_text_block(p); } *************** *** 2960,2966 **** d->output.tail = qp; *qp = cur->nxt; #ifdef DEBUG ! fprintf(stderr, "free_text_block(0x%x) at 2.\n", cur); #endif /* DEBUG */ free_text_block(cur); continue; /* do not adv ptr */ --- 2912,2918 ---- d->output.tail = qp; *qp = cur->nxt; #ifdef DEBUG ! do_rawlog(LT_DEBUG, "free_text_block(0x%x) at 2.", cur); #endif /* DEBUG */ free_text_block(cur); continue; /* do not adv ptr */ *************** *** 2998,3004 **** while (cur) { next = cur->nxt; #ifdef DEBUG ! fprintf(stderr, "free_text_block(0x%x) at 3.\n", cur); #endif /* DEBUG */ free_text_block(cur); cur = next; --- 2950,2956 ---- while (cur) { next = cur->nxt; #ifdef DEBUG ! do_rawlog(LT_DEBUG, "free_text_block(0x%x) at 3.", cur); #endif /* DEBUG */ free_text_block(cur); cur = next; *************** *** 3010,3016 **** while (cur) { next = cur->nxt; #ifdef DEBUG ! fprintf(stderr, "free_text_block(0x%x) at 4.\n", cur); #endif /* DEBUG */ free_text_block(cur); cur = next; --- 2962,2968 ---- while (cur) { next = cur->nxt; #ifdef DEBUG ! do_rawlog(LT_DEBUG, "free_text_block(0x%x) at 4.", cur); #endif /* DEBUG */ free_text_block(cur); cur = next; *************** *** 3070,3076 **** if ((fp = fopen(index_file, "rb")) == NULL) { notify(player, "Sorry, that function is temporarily unavailable."); ! do_log(LT_ERR, 0, 0, "Can't open index file %s for reading", index_file); return; } while ((help_found = fread(&entry, sizeof(help_indx), 1, fp)) == 1) --- 3022,3028 ---- if ((fp = fopen(index_file, "rb")) == NULL) { notify(player, "Sorry, that function is temporarily unavailable."); ! do_rawlog(LT_ERR, "Can't open index file %s for reading", index_file); return; } while ((help_found = fread(&entry, sizeof(help_indx), 1, fp)) == 1) *************** *** 3083,3094 **** } if ((fp = fopen(text_file, "rb")) == NULL) { notify(player, "Sorry, that function is temporarily unavailable."); ! do_log(LT_ERR, 0, 0, "Can't open text file %s for reading", text_file); return; } if (fseek(fp, entry.pos, 0) < 0L) { notify(player, "Sorry, that function is temporarily unavailable."); ! do_log(LT_ERR, 0, 0, "Seek error in file %s\n", text_file); return; } strcpy(the_topic, strupper(entry.topic + (*entry.topic == '&'))); --- 3035,3046 ---- } if ((fp = fopen(text_file, "rb")) == NULL) { notify(player, "Sorry, that function is temporarily unavailable."); ! do_rawlog(LT_ERR, "Can't open text file %s for reading", text_file); return; } if (fseek(fp, entry.pos, 0) < 0L) { notify(player, "Sorry, that function is temporarily unavailable."); ! do_rawlog(LT_ERR, "Seek error in file %s\n", text_file); return; } strcpy(the_topic, strupper(entry.topic + (*entry.topic == '&'))); *************** *** 3234,3240 **** cdesc->input.tail = &cdesc->input.head; if (t) { #ifdef DEBUG ! fprintf(stderr, "free_text_block(0x%x) at 5.\n", t); #endif /* DEBUG */ free_text_block(t); } --- 3186,3192 ---- cdesc->input.tail = &cdesc->input.head; if (t) { #ifdef DEBUG ! do_rawlog(LT_DEBUG, "free_text_block(0x%x) at 5.", t); #endif /* DEBUG */ free_text_block(t); } *************** *** 3291,3297 **** && !strncmp(command, PUEBLO_COMMAND, strlen(PUEBLO_COMMAND))) { if (!d->pueblo) { queue_newwrite(d, PUEBLO_SEND, strlen(PUEBLO_SEND)); ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Switching to Pueblo mode.", d->descriptor, d->addr, d->ip); d->pueblo = 1; if (!d->connected) --- 3243,3249 ---- && !strncmp(command, PUEBLO_COMMAND, strlen(PUEBLO_COMMAND))) { if (!d->pueblo) { queue_newwrite(d, PUEBLO_SEND, strlen(PUEBLO_SEND)); ! do_rawlog(LT_CONN, "[%d/%s/%s] Switching to Pueblo mode.", d->descriptor, d->addr, d->ip); d->pueblo = 1; if (!d->connected) *************** *** 3432,3441 **** if (string_prefix("connect", command)) { if ((player = connect_player(user, password, d->addr, d->ip)) == NOTHING) { queue_string(d, connect_fail); ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Failed connect to '%s'.", d->descriptor, d->addr, d->ip, user); } else { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Connected to %s(#%d) in %s(#%d)", d->descriptor, d->addr, d->ip, Name(player), player, Name(Location(player)), Location(player)); if ((dump_messages(d, player, 0)) == 0) { --- 3384,3393 ---- if (string_prefix("connect", command)) { if ((player = connect_player(user, password, d->addr, d->ip)) == NOTHING) { queue_string(d, connect_fail); ! do_rawlog(LT_CONN, "[%d/%s/%s] Failed connect to '%s'.", d->descriptor, d->addr, d->ip, user); } else { ! do_rawlog(LT_CONN, "[%d/%s/%s] Connected to %s(#%d) in %s(#%d)", d->descriptor, d->addr, d->ip, Name(player), player, Name(Location(player)), Location(player)); if ((dump_messages(d, player, 0)) == 0) { *************** *** 3447,3456 **** } else if (!strcasecmp(command, "cd")) { if ((player = connect_player(user, password, d->addr, d->ip)) == NOTHING) { queue_string(d, connect_fail); ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Failed connect to '%s'.", d->descriptor, d->addr, d->ip, user); } else { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Connected dark to %s(#%d) in %s(#%d)", d->descriptor, d->addr, d->ip, Name(player), player, Name(Location(player)), Location(player)); --- 3399,3408 ---- } else if (!strcasecmp(command, "cd")) { if ((player = connect_player(user, password, d->addr, d->ip)) == NOTHING) { queue_string(d, connect_fail); ! do_rawlog(LT_CONN, "[%d/%s/%s] Failed connect to '%s'.", d->descriptor, d->addr, d->ip, user); } else { ! do_rawlog(LT_CONN, "[%d/%s/%s] Connected dark to %s(#%d) in %s(#%d)", d->descriptor, d->addr, d->ip, Name(player), player, Name(Location(player)), Location(player)); *************** *** 3467,3476 **** } else if (!strcasecmp(command, "cv")) { if ((player = connect_player(user, password, d->addr, d->ip)) == NOTHING) { queue_string(d, connect_fail); ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Failed connect to '%s'.", d->descriptor, d->addr, d->ip, user); } else { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Connected to %s(#%d) in %s(#%d)", d->descriptor, d->addr, d->ip, Name(player), player, Name(Location(player)), Location(player)); /* Set player !dark */ --- 3419,3428 ---- } else if (!strcasecmp(command, "cv")) { if ((player = connect_player(user, password, d->addr, d->ip)) == NOTHING) { queue_string(d, connect_fail); ! do_rawlog(LT_CONN, "[%d/%s/%s] Failed connect to '%s'.", d->descriptor, d->addr, d->ip, user); } else { ! do_rawlog(LT_CONN, "[%d/%s/%s] Connected to %s(#%d) in %s(#%d)", d->descriptor, d->addr, d->ip, Name(player), player, Name(Location(player)), Location(player)); /* Set player !dark */ *************** *** 3486,3495 **** } else if (!strcasecmp(command, "ch")) { if ((player = connect_player(user, password, d->addr, d->ip)) == NOTHING) { queue_string(d, connect_fail); ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Failed connect to '%s'.", d->descriptor, d->addr, d->ip, user); } else { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Connected hidden to %s(#%d) in %s(#%d)", d->descriptor, d->addr, d->ip, Name(player), player, Name(Location(player)), Location(player)); --- 3438,3447 ---- } else if (!strcasecmp(command, "ch")) { if ((player = connect_player(user, password, d->addr, d->ip)) == NOTHING) { queue_string(d, connect_fail); ! do_rawlog(LT_CONN, "[%d/%s/%s] Failed connect to '%s'.", d->descriptor, d->addr, d->ip, user); } else { ! do_rawlog(LT_CONN, "[%d/%s/%s] Connected hidden to %s(#%d) in %s(#%d)", d->descriptor, d->addr, d->ip, Name(player), player, Name(Location(player)), Location(player)); *************** *** 3509,3515 **** fcache_dump(d, options.register_fcache); if (!Deny_Silent_Site(d->addr, AMBIGUOUS) && !Deny_Silent_Site(d->ip, AMBIGUOUS)) { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Refused create for '%s'.", d->descriptor, d->addr, d->ip, user); } return 0; --- 3461,3467 ---- fcache_dump(d, options.register_fcache); if (!Deny_Silent_Site(d->addr, AMBIGUOUS) && !Deny_Silent_Site(d->ip, AMBIGUOUS)) { ! do_rawlog(LT_CONN, "[%d/%s/%s] Refused create for '%s'.", d->descriptor, d->addr, d->ip, user); } return 0; *************** *** 3530,3545 **** player = create_player(user, password, d->addr, d->ip); if (player == NOTHING) { queue_string(d, create_fail); ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Failed create for '%s' (bad name).", d->descriptor, d->addr, d->ip, user); } else if (player == AMBIGUOUS) { queue_string(d, create_fail); ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Failed create for '%s' (bad password).", d->descriptor, d->addr, d->ip, user); } else { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Created %s(#%d)", d->descriptor, d->addr, d->ip, Name(player), player); if ((dump_messages(d, player, 1)) == 0) { d->connected = 2; --- 3482,3497 ---- player = create_player(user, password, d->addr, d->ip); if (player == NOTHING) { queue_string(d, create_fail); ! do_rawlog(LT_CONN, "[%d/%s/%s] Failed create for '%s' (bad name).", d->descriptor, d->addr, d->ip, user); } else if (player == AMBIGUOUS) { queue_string(d, create_fail); ! do_rawlog(LT_CONN, "[%d/%s/%s] Failed create for '%s' (bad password).", d->descriptor, d->addr, d->ip, user); } else { ! do_rawlog(LT_CONN, "[%d/%s/%s] Created %s(#%d)", d->descriptor, d->addr, d->ip, Name(player), player); if ((dump_messages(d, player, 1)) == 0) { d->connected = 2; *************** *** 3552,3558 **** fcache_dump(d, options.register_fcache); if (!Deny_Silent_Site(d->addr, AMBIGUOUS) && !Deny_Silent_Site(d->ip, AMBIGUOUS)) { ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Refused registration (bad site) for '%s'.", d->descriptor, d->addr, d->ip, user); } --- 3504,3510 ---- fcache_dump(d, options.register_fcache); if (!Deny_Silent_Site(d->addr, AMBIGUOUS) && !Deny_Silent_Site(d->ip, AMBIGUOUS)) { ! do_rawlog(LT_CONN, "[%d/%s/%s] Refused registration (bad site) for '%s'.", d->descriptor, d->addr, d->ip, user); } *************** *** 3568,3578 **** if ((player = email_register_player(user, password, d->addr, d->ip)) == NOTHING) { queue_string(d, register_fail); ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Failed registration for '%s'.", d->descriptor, d->addr, d->ip, user); } else { queue_string(d, register_success); ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Registered %s(#%d) to %s", d->descriptor, d->addr, d->ip, Name(player), player, password); } /* Even when registration succeeds, they don't connect, so return 0 */ --- 3520,3530 ---- if ((player = email_register_player(user, password, d->addr, d->ip)) == NOTHING) { queue_string(d, register_fail); ! do_rawlog(LT_CONN, "[%d/%s/%s] Failed registration for '%s'.", d->descriptor, d->addr, d->ip, user); } else { queue_string(d, register_success); ! do_rawlog(LT_CONN, "[%d/%s/%s] Registered %s(#%d) to %s", d->descriptor, d->addr, d->ip, Name(player), player, password); } /* Even when registration succeeds, they don't connect, so return 0 */ *************** *** 3749,3755 **** sig; { ! do_rawlog(LT_ERR, "SIGNAL_SHUTDOWN: caught signal %d", sig); signal_shutdown_flag = 1; #ifndef VOIDSIG return 0; --- 3701,3707 ---- sig; { ! do_rawlog(LT_NOTICE, "SIGNAL_SHUTDOWN: caught signal %d", sig); signal_shutdown_flag = 1; #ifndef VOIDSIG return 0; *************** *** 3762,3768 **** sig; { ! do_rawlog(LT_ERR, "SIGNAL_DUMP: caught signal %d", sig); signal_dump_flag = 1; #ifndef VOIDSIG return 0; --- 3714,3720 ---- sig; { ! do_rawlog(LT_NOTICE, "SIGNAL_DUMP: caught signal %d", sig); signal_dump_flag = 1; #ifndef VOIDSIG return 0; *************** *** 3812,3818 **** char tbuf2[BUFFER_LEN]; if (!GoodObject(call_by->player)) { ! do_log(LT_ERR, 0, 0, "Bogus caller #%d of dump_users", call_by->player); return; } while (*match && *match == ' ') --- 3764,3770 ---- char tbuf2[BUFFER_LEN]; if (!GoodObject(call_by->player)) { ! do_rawlog(LT_ERR, "Bogus caller #%d of dump_users", call_by->player); return; } while (*match && *match == ' ') *************** *** 4070,4076 **** } break; default: ! do_log(LT_ERR, 0, 0, "Invalid zone #%d for %s(#%d) has bad type %d", zone, Name(player), player, Typeof(zone)); } --- 4022,4028 ---- } break; default: ! do_rawlog(LT_ERR, "Invalid zone #%d for %s(#%d) has bad type %d", zone, Name(player), player, Typeof(zone)); } *************** *** 4176,4182 **** } break; default: ! do_log(LT_ERR, 0, 0, "Invalid zone #%d for %s(#%d) has bad type %d", zone, Name(player), player, Typeof(zone)); } --- 4128,4134 ---- } break; default: ! do_rawlog(LT_ERR, "Invalid zone #%d for %s(#%d) has bad type %d", zone, Name(player), player, Typeof(zone)); } *************** *** 4442,4449 **** /* if we hit this point we are in trouble */ safe_str("#-1", buff, bp); ! do_log(LT_ERR, 0, 0, ! "Whoa. doing() can't find player #%d on call by #%d\n", target, executor); } --- 4394,4401 ---- /* if we hit this point we are in trouble */ safe_str("#-1", buff, bp); ! do_rawlog(LT_ERR, ! "Whoa. doing() can't find player #%d on call by #%d", target, executor); } *************** *** 4661,4667 **** else if (!Can_Idle(d->player)) { notify(d->player, "\n*** Inactivity timeout ***\n"); ! do_log(LT_CONN, 0, 0, "[%d/%s/%s] Logout by %s(#%d) ", d->descriptor, d->addr, d->ip, Name(d->player), d->player); boot_desc(d); --- 4613,4619 ---- else if (!Can_Idle(d->player)) { notify(d->player, "\n*** Inactivity timeout ***\n"); ! do_rawlog(LT_CONN, "[%d/%s/%s] Logout by %s(#%d) ", d->descriptor, d->addr, d->ip, Name(d->player), d->player); boot_desc(d); *************** *** 5222,5234 **** safe_str((char *) hostname_convert(SockAddr.sin_addr), tbuf1, &bp); *bp = '\0'; if (Forbidden_Site(tbuf1) || Forbidden_Site(tbuf2)) { ! do_log(LT_CONN, 0, 0, "[%d/%s] Refused connection (remote port %d)", socketClient, tbuf1, ntohs(SockAddr.sin_port)); shutdown(socketClient, 2); closesocket(socketClient); continue; } ! do_log(LT_CONN, 0, 0, "[%d/%s] Connection opened.", socketClient, tbuf1); d = initializesock(socketClient, tbuf1, tbuf2); --- 5174,5186 ---- safe_str((char *) hostname_convert(SockAddr.sin_addr), tbuf1, &bp); *bp = '\0'; if (Forbidden_Site(tbuf1) || Forbidden_Site(tbuf2)) { ! do_rawlog(LT_CONN, "[%d/%s] Refused connection (remote port %d)", socketClient, tbuf1, ntohs(SockAddr.sin_port)); shutdown(socketClient, 2); closesocket(socketClient); continue; } ! do_rawlog(LT_CONN, "[%d/%s] Connection opened.", socketClient, tbuf1); d = initializesock(socketClient, tbuf1, tbuf2); *** /usr/local/mu/pennmush/src/cmds.c Mon Jul 17 10:59:52 2000 --- src/cmds.c Tue Jul 18 09:07:46 2000 *************** *** 403,435 **** } COMMAND (cmd_log) { ! if (SW_ISSET(sw, SWITCH_CHECK)) ! do_writelog(player, arg_left, LT_CHECK); else if (SW_ISSET(sw, SWITCH_CMD)) do_writelog(player, arg_left, LT_CMD); else if (SW_ISSET(sw, SWITCH_CONN)) do_writelog(player, arg_left, LT_CONN); - else if (SW_ISSET(sw, SWITCH_ERR)) - do_writelog(player, arg_left, LT_ERR); else if (SW_ISSET(sw, SWITCH_TRACE)) do_writelog(player, arg_left, LT_TRACE); ! else if (SW_ISSET(sw, SWITCH_WIZ)) ! do_writelog(player, arg_left, LT_WIZ); else ! do_writelog(player, arg_left, LT_CMD); } COMMAND (cmd_logwipe) { ! if (SW_ISSET(sw, SWITCH_CHECK)) ! do_logwipe(player, LT_CHECK, arg_left); else if (SW_ISSET(sw, SWITCH_CMD)) do_logwipe(player, LT_CMD, arg_left); else if (SW_ISSET(sw, SWITCH_CONN)) do_logwipe(player, LT_CONN, arg_left); else if (SW_ISSET(sw, SWITCH_TRACE)) do_logwipe(player, LT_TRACE, arg_left); ! else if (SW_ISSET(sw, SWITCH_WIZ)) ! do_logwipe(player, LT_WIZ, arg_left); else do_logwipe(player, LT_ERR, arg_left); } --- 403,473 ---- } COMMAND (cmd_log) { ! if (SW_ISSET(sw, SWITCH_ERR)) ! do_writelog(player, arg_left, LT_ERR); else if (SW_ISSET(sw, SWITCH_CMD)) do_writelog(player, arg_left, LT_CMD); + else if (SW_ISSET(sw, SWITCH_WIZ)) + do_writelog(player, arg_left, LT_WIZ); else if (SW_ISSET(sw, SWITCH_CONN)) do_writelog(player, arg_left, LT_CONN); else if (SW_ISSET(sw, SWITCH_TRACE)) do_writelog(player, arg_left, LT_TRACE); ! else if (SW_ISSET(sw, SWITCH_CHECK)) ! do_writelog(player, arg_left, LT_CHECK); ! else if (SW_ISSET(sw, SWITCH_HUH)) ! do_writelog(player, arg_left, LT_HUH); ! else if (SW_ISSET(sw, SWITCH_SUSPECT)) ! do_writelog(player, arg_left, LT_SUSPECT); ! else if (SW_ISSET(sw, SWITCH_NOTICE)) ! do_writelog(player, arg_left, LT_NOTICE); ! else if (SW_ISSET(sw, SWITCH_CONFIG)) ! do_writelog(player, arg_left, LT_CONFIG); ! else if (SW_ISSET(sw, SWITCH_PANIC)) ! do_writelog(player, arg_left, LT_PANIC); ! else if (SW_ISSET(sw, SWITCH_DEBUG)) ! do_writelog(player, arg_left, LT_DEBUG); ! else if (SW_ISSET(sw, SWITCH_USER1)) ! do_writelog(player, arg_left, LT_USER1); ! else if (SW_ISSET(sw, SWITCH_USER2)) ! do_writelog(player, arg_left, LT_USER2); ! else if (SW_ISSET(sw, SWITCH_USER3)) ! do_writelog(player, arg_left, LT_USER3); else ! do_writelog(player, arg_left, LT_NOTICE); } COMMAND (cmd_logwipe) { ! if (SW_ISSET(sw, SWITCH_ERR)) ! do_logwipe(player, LT_ERR, arg_left); else if (SW_ISSET(sw, SWITCH_CMD)) do_logwipe(player, LT_CMD, arg_left); + else if (SW_ISSET(sw, SWITCH_WIZ)) + do_logwipe(player, LT_WIZ, arg_left); else if (SW_ISSET(sw, SWITCH_CONN)) do_logwipe(player, LT_CONN, arg_left); else if (SW_ISSET(sw, SWITCH_TRACE)) do_logwipe(player, LT_TRACE, arg_left); ! else if (SW_ISSET(sw, SWITCH_CHECK)) ! do_logwipe(player, LT_CHECK, arg_left); ! else if (SW_ISSET(sw, SWITCH_HUH)) ! do_logwipe(player, LT_HUH, arg_left); ! else if (SW_ISSET(sw, SWITCH_SUSPECT)) ! do_logwipe(player, LT_SUSPECT, arg_left); ! else if (SW_ISSET(sw, SWITCH_NOTICE)) ! do_logwipe(player, LT_NOTICE, arg_left); ! else if (SW_ISSET(sw, SWITCH_CONFIG)) ! do_logwipe(player, LT_CONFIG, arg_left); ! else if (SW_ISSET(sw, SWITCH_PANIC)) ! do_logwipe(player, LT_PANIC, arg_left); ! else if (SW_ISSET(sw, SWITCH_DEBUG)) ! do_logwipe(player, LT_DEBUG, arg_left); ! else if (SW_ISSET(sw, SWITCH_USER1)) ! do_logwipe(player, LT_USER1, arg_left); ! else if (SW_ISSET(sw, SWITCH_USER2)) ! do_logwipe(player, LT_USER2, arg_left); ! else if (SW_ISSET(sw, SWITCH_USER3)) ! do_logwipe(player, LT_USER3, arg_left); else do_logwipe(player, LT_ERR, arg_left); } *** /usr/local/mu/pennmush/src/command.c Mon Jul 17 10:59:53 2000 --- src/command.c Tue Jul 18 09:07:46 2000 *************** *** 152,161 **** CMD_T_ANY, 0, 0, 0}, {"@LOCK", NULL, cmd_lock, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_SWITCHES | CMD_T_NOGAGGED, 0, 0, 0}, ! {"@LOG", "CHECK CMD CONN ERR TRACE WIZ", cmd_log, ! CMD_T_ANY | CMD_T_NOGAGGED, WIZARD, 0, 0}, ! {"@LOGWIPE", "CHECK CMD CONN ERR TRACE WIZ", cmd_logwipe, ! CMD_T_ANY | CMD_T_NOGAGGED, WIZARD, 0, 0}, #ifdef USE_MAILER {"@MAIL", "NOEVAL NOSIG STATS DSTATS FSTATS DEBUG NUKE FOLDER UNFOLDER LIST READ CLEAR UNCLEAR PURGE FILE TAG UNTAG FWD FORWARD SEND SILENT URGENT", --- 152,159 ---- CMD_T_ANY, 0, 0, 0}, {"@LOCK", NULL, cmd_lock, CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_SWITCHES | CMD_T_NOGAGGED, 0, 0, 0}, ! {"@LOG", "DEBUG CHECK CMD CONFIG CONN ERR HUH NOTICE PANIC SUSPECT TRACE USER1 USER2 USER3 WIZ", cmd_log, CMD_T_ANY | CMD_T_NOGAGGED, WIZARD, 0, 0}, ! {"@LOGWIPE", "DEBUG CHECK CMD CONFIG CONN ERR HUH NOTICE PANIC SUSPECT TRACE USER1 USER2 USER3 WIZ", cmd_logwipe, CMD_T_ANY | CMD_T_NOGAGGED, WIZARD, 0, 0}, #ifdef USE_MAILER {"@MAIL", "NOEVAL NOSIG STATS DSTATS FSTATS DEBUG NUKE FOLDER UNFOLDER LIST READ CLEAR UNCLEAR PURGE FILE TAG UNTAG FWD FORWARD SEND SILENT URGENT", *** /usr/local/mu/pennmush/src/conf.c Mon Jul 17 10:59:53 2000 --- src/conf.c Tue Jul 18 09:12:13 2000 *************** *** 140,149 **** "files"}, {"guest_html_file", cf_str, (int *) options.guest_file[1], 256, 0, "files"}, ! {"log_commands", cf_bool, &options.log_commands, 2, 0, "log"}, ! {"log_huhs", cf_bool, &options.log_huhs, 2, 0, "log"}, {"log_forces", cf_bool, &options.log_forces, 2, 0, "log"}, {"log_walls", cf_bool, &options.log_walls, 2, 0, "log"}, {"pueblo", cf_bool, &options.support_pueblo, 2, 0, "net"}, {"logins", cf_bool, &options.login_allow, 2, 0, "net"}, {"player_creation", cf_bool, &options.create_allow, 2, 0, "net"}, --- 140,195 ---- "files"}, {"guest_html_file", cf_str, (int *) options.guest_file[1], 256, 0, "files"}, ! {"err_log", cf_str, (int *) options.logfiles[0], 256, 0, "logfiles"}, ! {"cmd_log", cf_str, (int *) options.logfiles[1], 256, 0, "logfiles"}, ! {"wiz_log", cf_str, (int *) options.logfiles[2], 256, 0, "logfiles"}, ! {"conn_log", cf_str, (int *) options.logfiles[3], 256, 0, "logfiles"}, ! {"trace_log", cf_str, (int *) options.logfiles[4], 256, 0, "logfiles"}, ! {"check_log", cf_str, (int *) options.logfiles[6], 256, 0, "logfiles"}, ! {"huh_log", cf_str, (int *) options.logfiles[7], 256, 0, "logfiles"}, ! {"suspect_log", cf_str, (int *) options.logfiles[8], 256, 0, "logfiles"}, ! {"notice_log", cf_str, (int *) options.logfiles[9], 256, 0, "logfiles"}, ! {"config_log", cf_str, (int *) options.logfiles[10], 256, 0, "logfiles"}, ! {"panic_log", cf_str, (int *) options.logfiles[11], 256, 0, "logfiles"}, ! {"debug_log", cf_str, (int *) options.logfiles[12], 256, 0, "logfiles"}, ! {"user1_log", cf_str, (int *) options.logfiles[13], 256, 0, "logfiles"}, ! {"user2_log", cf_str, (int *) options.logfiles[14], 256, 0, "logfiles"}, ! {"user3_log", cf_str, (int *) options.logfiles[15], 256, 0, "logfiles"}, {"log_forces", cf_bool, &options.log_forces, 2, 0, "log"}, {"log_walls", cf_bool, &options.log_walls, 2, 0, "log"}, + {"use_chanlog", cf_bool, &options.use_chanlog, 2, 0, "logchan"}, + {"err_log_channel", cf_str, (int *) options.log_channel[0], 30, 0, "logchan"}, + {"cmd_log_channel", cf_str, (int *) options.log_channel[1], 30, 0, "logchan"}, + {"wiz_log_channel", cf_str, (int *) options.log_channel[2], 30, 0, "logchan"}, + {"conn_log_channel", cf_str, (int *) options.log_channel[3], 30, 0, "logchan"}, + {"trace_log_channel", cf_str, (int *) options.log_channel[4], 30, 0, "logchan"}, + {"check_log_channel", cf_str, (int *) options.log_channel[6], 30, 0, "logchan"}, + {"huh_log_channel", cf_str, (int *) options.log_channel[7], 30, 0, "logchan"}, + {"suspect_log_channel", cf_str, (int *) options.log_channel[8], 30, 0, "logchan"}, + {"notice_log_channel", cf_str, (int *) options.log_channel[9], 30, 0, "logchan"}, + {"config_log_channel", cf_str, (int *) options.log_channel[10], 30, 0, "logchan"}, + {"panic_log_channel", cf_str, (int *) options.log_channel[11], 30, 0, "logchan"}, + {"debug_log_channel", cf_str, (int *) options.log_channel[12], 30, 0, "logchan"}, + {"user1_log_channel", cf_str, (int *) options.log_channel[13], 30, 0, "logchan"}, + {"user2_log_channel", cf_str, (int *) options.log_channel[14], 30, 0, "logchan"}, + {"user3_log_channel", cf_str, (int *) options.log_channel[15], 30, 0, "logchan"}, + {"use_syslog", cf_bool, &options.use_syslog, 2, 0, "log_syslog"}, + {"syslog_name", cf_str, (int *) options.syslog_name, 32, 0, "log_syslog"}, + {"err_log_level", cf_int, &options.log_level[0], 5000, 0, "log_syslog"}, + {"cmd_log_level", cf_int, &options.log_level[1], 5000, 0, "log_syslog"}, + {"wiz_log_level", cf_int, &options.log_level[2], 5000, 0, "log_syslog"}, + {"conn_log_level", cf_int, &options.log_level[3], 5000, 0, "log_syslog"}, + {"trace_log_level", cf_int, &options.log_level[4], 5000, 0, "log_syslog"}, + {"check_log_level", cf_int, &options.log_level[6], 5000, 0, "log_syslog"}, + {"huh_log_level", cf_int, &options.log_level[7], 5000, 0, "log_syslog"}, + {"suspect_log_level", cf_int, &options.log_level[8], 5000, 0, "log_syslog"}, + {"notice_log_level", cf_int, &options.log_level[9], 5000, 0, "log_syslog"}, + {"config_log_level", cf_int, &options.log_level[10], 5000, 0, "log_syslog"}, + {"panic_log_level", cf_int, &options.log_level[11], 5000, 0, "log_syslog"}, + {"debug_log_level", cf_int, &options.log_level[12], 5000, 0, "log_syslog"}, + {"user1_log_level", cf_int, &options.log_level[13], 5000, 0, "log_syslog"}, + {"user2_log_level", cf_int, &options.log_level[14], 5000, 0, "log_syslog"}, + {"user3_log_level", cf_int, &options.log_level[15], 5000, 0, "log_syslog"}, {"pueblo", cf_bool, &options.support_pueblo, 2, 0, "net"}, {"logins", cf_bool, &options.login_allow, 2, 0, "net"}, {"player_creation", cf_bool, &options.create_allow, 2, 0, "net"}, *************** *** 268,273 **** --- 314,322 ---- {"funcs", "Options affecting function behavior", 0}, {"limits", "Limits and other constants", 0}, {"log", "Logging options", 0}, + {"logfiles", "Logging filenames", 0}, + {"logchan", "Channing logging options", 0}, + {"log_syslog", "Syslog logging levels", 0}, {"net", "Networking and connection-related options", 0}, {"tiny", "TinyMUSH compatibility options", 0}, {NULL, NULL, 0} *************** *** 291,298 **** *loc = 0; else { if (source == 0) { ! fprintf(stderr, "CONFIG: option %s value %s invalid.\n", opt, val); ! fflush(stderr); } return 0; } --- 340,346 ---- *loc = 0; else { if (source == 0) { ! do_rawlog(LT_CONFIG, "option %s value %s invalid.", opt, val); } return 0; } *************** *** 314,321 **** if (strlen(val) >= (Size_t) maxval) { val[maxval - 1] = '\0'; if (source == 0) { ! fprintf(stderr, "CONFIG: option %s value truncated\n", opt); ! fflush(stderr); } } strcpy((char *) loc, val); --- 362,368 ---- if (strlen(val) >= (Size_t) maxval) { val[maxval - 1] = '\0'; if (source == 0) { ! do_rawlog(LT_CONFIG, "option %s value truncated", opt); } } strcpy((char *) loc, val); *************** *** 341,348 **** if ((maxval >= 0) && (n > maxval)) { n = maxval; if (source == 0) { ! fprintf(stderr, "CONFIG: option %s value limited to %d\n", opt, maxval); ! fflush(stderr); } } *loc = n; --- 388,394 ---- if ((maxval >= 0) && (n > maxval)) { n = maxval; if (source == 0) { ! do_rawlog(LT_CONFIG, "option %s value limited to %d", opt, maxval); } } *loc = n; *************** *** 379,395 **** break; default: if (source == 0) ! fprintf(stderr, "CONFIG: weird flag set directive '%s'\n", opt); } if (f == -1) { if (source == 0) ! fprintf(stderr, "CONFIG: flag '%s' cannot be set.\n", val); return 0; } if (f == -2) { if (source == 0) ! fprintf(stderr, "CONFIG: flag '%s' for type not found.\n", val); return 0; } if (!toggle) --- 425,441 ---- break; default: if (source == 0) ! do_rawlog(LT_CONFIG, "weird flag set directive '%s'", opt); } if (f == -1) { if (source == 0) ! do_rawlog(LT_CONFIG, "flag '%s' cannot be set.", val); return 0; } if (f == -2) { if (source == 0) ! do_rawlog(LT_CONFIG, "flag '%s' for type not found.", val); return 0; } if (!toggle) *************** *** 429,446 **** *p++ = '\0'; if (!restrict_command(val, p)) { if (source == 0) { ! fprintf(stderr, "CONFIG: Invalid command or restriction for %s.\n", val); - fflush(stderr); } return 0; } } else { if (source == 0) { ! fprintf(stderr, ! "CONFIG: restrict_command %s requires a restriction value.\n", val); - fflush(stderr); } return 0; } --- 475,489 ---- *p++ = '\0'; if (!restrict_command(val, p)) { if (source == 0) { ! do_rawlog(LT_CONFIG, "Invalid command or restriction for %s.", val); } return 0; } } else { if (source == 0) { ! do_rawlog(LT_CONFIG, "restrict_command %s requires a restriction value.", val); } return 0; } *************** *** 461,468 **** } if (source == 0) { ! fprintf(stderr, "CONFIG: directive '%s' in cnf file ignored.\n", opt); ! fflush(stderr); } return 0; } --- 504,510 ---- } if (source == 0) { ! do_rawlog(LT_CONFIG, "CONFIG: directive '%s' in cnf file ignored.", opt); } return 0; } *************** *** 533,540 **** strcpy(options.down_file[1], "txt/down.html"); strcpy(options.full_file[1], "txt/full.html"); strcpy(options.guest_file[1], "txt/guest.html"); ! options.log_commands = 0; ! options.log_huhs = 0; options.log_forces = 1; options.log_walls = 0; options.support_pueblo = 0; --- 575,647 ---- strcpy(options.down_file[1], "txt/down.html"); strcpy(options.full_file[1], "txt/full.html"); strcpy(options.guest_file[1], "txt/guest.html"); ! strcpy(options.logfiles[0], "log/netmush.log"); ! strcpy(options.logfiles[1], "none"); ! strcpy(options.logfiles[2], "log/wiz.log"); ! strcpy(options.logfiles[3], "log/conn.log"); ! strcpy(options.logfiles[4], "none"); ! strcpy(options.logfiles[5], "none"); ! strcpy(options.logfiles[6], "log/check.log"); ! strcpy(options.logfiles[7], "none"); ! strcpy(options.logfiles[8], "log/suspect.log"); ! strcpy(options.logfiles[9], "log/notice.log"); ! strcpy(options.logfiles[10], "log/config.log"); ! strcpy(options.logfiles[11], "log/panic.log"); ! strcpy(options.logfiles[12], "none"); ! strcpy(options.logfiles[13], "none"); ! strcpy(options.logfiles[14], "none"); ! strcpy(options.logfiles[15], "none"); ! strcpy(options.syslog_name, "PennMUSH"); ! options.use_syslog = 0; ! strcpy(options.log_channel[0], "none"); ! strcpy(options.log_channel[1], "none"); ! strcpy(options.log_channel[2], "none"); ! strcpy(options.log_channel[3], "none"); ! strcpy(options.log_channel[4], "none"); ! strcpy(options.log_channel[5], "none"); ! strcpy(options.log_channel[6], "none"); ! strcpy(options.log_channel[7], "none"); ! strcpy(options.log_channel[8], "none"); ! strcpy(options.log_channel[9], "none"); ! strcpy(options.log_channel[10], "none"); ! strcpy(options.log_channel[11], "none"); ! strcpy(options.log_channel[12], "none"); ! strcpy(options.log_channel[13], "none"); ! strcpy(options.log_channel[14], "none"); ! strcpy(options.log_channel[15], "none"); ! options.log_level[0] = 4; ! options.log_level[1] = 6; ! options.log_level[2] = 5; ! options.log_level[3] = 5; ! options.log_level[4] = -1; ! options.log_level[5] = -1; ! options.log_level[6] = 5; ! options.log_level[7] = 6; ! options.log_level[8] = 5; ! options.log_level[9] = 5; ! options.log_level[10] = 6; ! options.log_level[11] = 1; ! options.log_level[12] = -1; ! options.log_level[13] = -1; ! options.log_level[14] = -1; ! options.log_level[15] = -1; ! options.is_logged[0] = 1; ! options.is_logged[1] = 1; ! options.is_logged[2] = 1; ! options.is_logged[3] = 1; ! options.is_logged[4] = 1; ! options.is_logged[5] = 1; ! options.is_logged[6] = 1; ! options.is_logged[7] = 1; ! options.is_logged[8] = 1; ! options.is_logged[9] = 1; ! options.is_logged[10] = 1; ! options.is_logged[11] = 1; ! options.is_logged[12] = 1; ! options.is_logged[13] = 1; ! options.is_logged[14] = 1; ! options.is_logged[15] = 1; ! options.use_chanlog = 1; options.log_forces = 1; options.log_walls = 0; options.support_pueblo = 0; *************** *** 648,654 **** fp = fopen(cfile, "r"); if (fp == NULL) { ! do_rawlog(LT_ERR, "ERROR: Cannot open configuration file %s.\n", cfile); return 0; } conf_default_set(); /* initialize defaults */ --- 755,761 ---- fp = fopen(cfile, "r"); if (fp == NULL) { ! do_rawlog(LT_PANIC, "Cannot open configuration file %s.", cfile); return 0; } conf_default_set(); /* initialize defaults */ *************** *** 696,705 **** */ for (cp = conftable; cp->name; cp++) { if (!cp->overridden) { ! fprintf(stderr, ! "CONFIG: directive '%s' missing from cnf file, using default value.\n", cp->name); - fflush(stderr); } } --- 803,811 ---- */ for (cp = conftable; cp->name; cp++) { if (!cp->overridden) { ! do_rawlog(LT_CONFIG, ! "directive '%s' missing from cnf file, using default value.", cp->name); } } *************** *** 937,948 **** #endif #if (COMPRESSION_TYPE == 3) notify(player, " Attributes are word compressed in memory."); - #endif - - #ifdef SINGLE_LOGFILE - notify(player, " Logging is to a single log file."); - #else - notify(player, " Logging is to multiple log files."); #endif #ifdef MEM_CHECK --- 1043,1048 ---- *** /usr/local/mu/pennmush/src/db.c Mon Jul 17 10:59:53 2000 --- src/db.c Tue Jul 18 09:07:47 2000 *************** *** 149,156 **** db_size *= 2; if ((db = (struct object *) malloc(db_size * sizeof(struct object))) == NULL) { ! fprintf(stderr, "ERROR: out of memory!\n"); ! fflush(stderr); abort(); } } --- 149,155 ---- db_size *= 2; if ((db = (struct object *) malloc(db_size * sizeof(struct object))) == NULL) { ! do_rawlog(LT_PANIC, "out of memory!"); abort(); } } *************** *** 161,168 **** db_size *= 2; if ((newdb = (struct object *) realloc(db, db_size * sizeof(struct object))) == NULL) { ! fprintf(stderr, "ERROR: out of memory!\n"); ! fflush(stderr); abort(); } db = newdb; --- 160,166 ---- db_size *= 2; if ((newdb = (struct object *) realloc(db, db_size * sizeof(struct object))) == NULL) { ! do_rawlog(LT_PANIC, "out of memory!"); abort(); } db = newdb; *************** *** 564,577 **** strcpy(name, tbuf1); } do_rawlog(LT_CHECK, ! " * Bad attribute name on #%d. Changing name to %s.\n", i, name); err = 0; } /* check the owner */ owner = AL_CREATOR(list); if (!GoodObject(owner)) { ! do_rawlog(LT_CHECK, " * Bad owner on attribute %s on #%d.\n", name, i); owner = GOD; fixmemdb = 1; } else { --- 562,575 ---- strcpy(name, tbuf1); } do_rawlog(LT_CHECK, ! " * Bad attribute name on #%d. Changing name to %s.", i, name); err = 0; } /* check the owner */ owner = AL_CREATOR(list); if (!GoodObject(owner)) { ! do_rawlog(LT_CHECK, " * Bad owner on attribute %s on #%d.", name, i); owner = GOD; fixmemdb = 1; } else { *************** *** 605,612 **** if (err) { fixmemdb = 1; do_rawlog(LT_CHECK, ! " * Bad text in attribute %s on #%d. Changed to:\n", name, i); ! do_rawlog(LT_CHECK, "%s\n", tbuf1); } putstring(f, tbuf1); if (flag && fixmemdb) { --- 603,610 ---- if (err) { fixmemdb = 1; do_rawlog(LT_CHECK, ! " * Bad text in attribute %s on #%d. Changed to:", name, i); ! do_rawlog(LT_CHECK, "%s", tbuf1); } putstring(f, tbuf1); if (flag && fixmemdb) { *************** *** 663,669 **** fprintf(f, "+V%d\n", dbflag * 256 + 2); ! do_rawlog(LT_CHECK, "PARANOID WRITE BEGINNING...\n"); /* print total number of objects at top of file */ fprintf(f, "~%d\n", db_top); --- 661,667 ---- fprintf(f, "+V%d\n", dbflag * 256 + 2); ! do_rawlog(LT_CHECK, "PARANOID WRITE BEGINNING..."); /* print total number of objects at top of file */ fprintf(f, "~%d\n", db_top); *************** *** 683,693 **** db_paranoid_write_object(f, i, flag); /* print out a message every so many objects */ if (i % paranoid_checkpt == 0) ! do_rawlog(LT_CHECK, "\t...wrote up to object #%d\n", i); } fputs("***END OF DUMP***\n", f); ! do_rawlog(LT_CHECK, "\t...finished at object #%d\n", i - 1); ! do_rawlog(LT_CHECK, "END OF PARANOID WRITE.\n"); return (db_top); } --- 681,691 ---- db_paranoid_write_object(f, i, flag); /* print out a message every so many objects */ if (i % paranoid_checkpt == 0) ! do_rawlog(LT_CHECK, "...wrote up to object #%d", i); } fputs("***END OF DUMP***\n", f); ! do_rawlog(LT_CHECK, "...finished at object #%d", i - 1); ! do_rawlog(LT_CHECK, "END OF PARANOID WRITE."); return (db_top); } *************** *** 833,839 **** return TRUE_BOOLEXP; /* break; */ case EOF: ! fprintf(stderr, "ERROR: Unexpected EOF in boolexp. Object #%d\n", errobj); return TRUE_BOOLEXP; /*NOTREACHED */ break; --- 831,837 ---- return TRUE_BOOLEXP; /* break; */ case EOF: ! do_rawlog(LT_ERR, "Unexpected EOF in boolexp. Object #%d", errobj); return TRUE_BOOLEXP; /*NOTREACHED */ break; *************** *** 894,900 **** /* eat it */ while ((c = getc(f)) != '\n') if (c == EOF) { ! fprintf(stderr, "ERROR: Unexpected EOF in boolexp. Object #%d\n", errobj); return TRUE_BOOLEXP; } --- 892,898 ---- /* eat it */ while ((c = getc(f)) != '\n') if (c == EOF) { ! do_rawlog(LT_ERR, "Unexpected EOF in boolexp. Object #%d", errobj); return TRUE_BOOLEXP; } *************** *** 908,914 **** strcpy(tbuf1, getstring_noalloc(f)); c = fgetc(f); if (c == EOF) { ! fprintf(stderr, "ERROR: Unexpected EOF in boolexp. Object #%d\n", errobj); return TRUE_BOOLEXP; } b = alloc_bool(); --- 906,912 ---- strcpy(tbuf1, getstring_noalloc(f)); c = fgetc(f); if (c == EOF) { ! do_rawlog(LT_ERR, "Unexpected EOF in boolexp. Object #%d", errobj); return TRUE_BOOLEXP; } b = alloc_bool(); *************** *** 987,993 **** } } error: ! fprintf(stderr, "ERROR: Unknown error in boolexp. Object #%d\n", errobj); return TRUE_BOOLEXP; } --- 985,991 ---- } } error: ! do_rawlog(LT_ERR, "Unknown error in boolexp. Object #%d", errobj); return TRUE_BOOLEXP; } *************** *** 998,1004 **** struct boolexp *b; b = getboolexp1(f); if (getc(f) != '\n') { ! fprintf(stderr, "ERROR: Invalid boolexp format on object #%d\n", errobj); return TRUE_BOOLEXP; } return b; --- 996,1002 ---- struct boolexp *b; b = getboolexp1(f); if (getc(f) != '\n') { ! do_rawlog(LT_ERR, "Invalid boolexp format on object #%d", errobj); return TRUE_BOOLEXP; } return b; *************** *** 1020,1026 **** } *p = '\0'; if (c == EOF || (p - buf == 0)) { ! fprintf(stderr, "ERROR: Invalid lock format on object #%d\n", i); return; } b = getboolexp(f); /* Which will clobber a '\n' */ --- 1018,1024 ---- } *p = '\0'; if (c == EOF || (p - buf == 0)) { ! do_rawlog(LT_ERR, "Invalid lock format on object #%d", i); return; } b = getboolexp(f); /* Which will clobber a '\n' */ *************** *** 1183,1189 **** r->atr_lock = alloc_atr(b->atr_lock->name, uncompress(b->atr_lock->text)); break; default: ! fprintf(stderr, "ERROR: bad bool type in dup_bool!\n"); return (TRUE_BOOLEXP); } return (r); --- 1181,1187 ---- r->atr_lock = alloc_atr(b->atr_lock->name, uncompress(b->atr_lock->text)); break; default: ! do_rawlog(LT_ERR, "bad bool type in dup_bool!"); return (TRUE_BOOLEXP); } return (r); *************** *** 1233,1245 **** case ']': /* new style attribs, read name then value */ strcpy(tbuf1, getstring_noalloc(f)); if (!(p = (char *) index(tbuf1, '^'))) { ! fprintf(stderr, "ERROR: Bad format on new attributes. object #%d\n", i); return -1; } *p++ = '\0'; if (!(q = (char *) index(p, '^'))) { ! fprintf(stderr, ! "ERROR: Bad format on new attribute %s. object #%d\n", tbuf1, i); return -1; } --- 1231,1243 ---- case ']': /* new style attribs, read name then value */ strcpy(tbuf1, getstring_noalloc(f)); if (!(p = (char *) index(tbuf1, '^'))) { ! do_rawlog(LT_PANIC, "Bad format on new attributes. object #%d", i); return -1; } *p++ = '\0'; if (!(q = (char *) index(p, '^'))) { ! do_rawlog(LT_PANIC, ! "Bad format on new attribute %s. object #%d", tbuf1, i); return -1; } *************** *** 1269,1276 **** nextc = getc(f); if ((nextc != ']') && (nextc != '>') && (nextc != '<') && (nextc != '!')) { /* we have a problem. print error */ ! fprintf(stderr, ! "** WARNING ** Hard newline in attribute %s on object #%d\n", tbuf1, i); /* throw out everything until next good attrib or object. * we can tell a good attrib or object by looking for a \n --- 1267,1274 ---- nextc = getc(f); if ((nextc != ']') && (nextc != '>') && (nextc != '<') && (nextc != '!')) { /* we have a problem. print error */ ! do_rawlog(LT_ERR, ! "Hard newline in attribute %s on object #%d", tbuf1, i); /* throw out everything until next good attrib or object. * we can tell a good attrib or object by looking for a \n *************** *** 1293,1316 **** break; case '<': /* end of list */ if ('\n' != getc(f)) { ! fprintf(stderr, "ERROR: no line feed after < on object %d\n", i); return -1; } return count; default: if (c == EOF) { ! fprintf(stderr, "ERROR: Unexpected EOF on file.\n"); return -1; } ! fprintf(stderr, ! "ERROR: Bad character %c (%d) in attribute list on object %d\n", c, c, i); ! fprintf(stderr, ! " (expecting ], >, or < as first character of the line.)\n"); if (*tbuf1) ! fprintf(stderr, " Last attribute read was: %s\n", tbuf1); else ! fprintf(stderr, " No attributes had been read yet.\n"); return -1; } } --- 1291,1314 ---- break; case '<': /* end of list */ if ('\n' != getc(f)) { ! do_rawlog(LT_PANIC, "no line feed after < on object %d", i); return -1; } return count; default: if (c == EOF) { ! do_rawlog(LT_PANIC, "Unexpected EOF on file."); return -1; } ! do_rawlog(LT_PANIC, ! "Bad character %c (%d) in attribute list on object %d", c, c, i); ! do_rawlog(LT_PANIC, ! " (expecting ], >, or < as first character of the line.)"); if (*tbuf1) ! do_rawlog(LT_PANIC, " Last attribute read was: %s", tbuf1); else ! do_rawlog(LT_PANIC, " No attributes had been read yet."); return -1; } } *************** *** 1350,1356 **** break; /* old fashioned database */ case '#': ! fprintf(stderr, "ERROR: old style database.\n"); /* if you want to read in an old-style database, use an earlier * patchlevel to upgrade. */ --- 1348,1354 ---- break; /* old fashioned database */ case '#': ! do_rawlog(LT_PANIC, "old style database."); /* if you want to read in an old-style database, use an earlier * patchlevel to upgrade. */ *************** *** 1469,1475 **** /* read attribute list for item */ if ((o->attrcount = get_list(f, i)) < 0) { ! fprintf(stderr, "ERROR: bad attribute list object %d\n", i); return -1; } /* check to see if it's a player */ --- 1467,1473 ---- /* read attribute list for item */ if ((o->attrcount = get_list(f, i)) < 0) { ! do_rawlog(LT_PANIC, "bad attribute list object %d", i); return -1; } /* check to see if it's a player */ *************** *** 1488,1507 **** case '*': end = getstring_noalloc(f); if (!strcmp(end, "***END OF DUMP***")) { ! fprintf(stderr, "ERROR: No end of dump %d\n", i); return -1; } else { ! { ! fprintf(stderr, "READING: done\n"); fix_free_list(); if (!(indb_flags & DBF_NEW_LOCKS)) tweak_locks(); dbck(); return db_top; - } } default: ! fprintf(stderr, "ERROR: failed object %d\n", i); return -1; } } --- 1486,1503 ---- case '*': end = getstring_noalloc(f); if (!strcmp(end, "***END OF DUMP***")) { ! do_rawlog(LT_PANIC, "No end of dump %d", i); return -1; } else { ! do_rawlog(LT_CHECK, "READING: done"); fix_free_list(); if (!(indb_flags & DBF_NEW_LOCKS)) tweak_locks(); dbck(); return db_top; } default: ! do_rawlog(LT_PANIC, "failed object %d", i); return -1; } } *** /usr/local/mu/pennmush/src/destroy.c Mon Jul 17 10:59:53 2000 --- src/destroy.c Tue Jul 18 09:07:47 2000 *************** *** 379,385 **** object_header(player, thing))); break; default: ! do_log(LT_ERR, NOTHING, NOTHING, "Surprising type in do_destroy."); return; } --- 379,385 ---- object_header(player, thing))); break; default: ! do_rawlog(LT_ERR, "Surprising type in do_destroy."); return; } *************** *** 467,473 **** } break; default: ! do_log(LT_ERR, NOTHING, NOTHING, "Surprising type in pre_destroy."); return; } --- 467,473 ---- } break; default: ! do_rawlog(LT_ERR, "Surprising type in pre_destroy."); return; } *************** *** 562,568 **** } break; default: ! do_log(LT_ERR, NOTHING, NOTHING, "Surprising type in un_destroy."); return; } } --- 562,568 ---- } break; default: ! do_rawlog(LT_ERR, "Surprising type in un_destroy."); return; } } *************** *** 596,602 **** clear_room(thing); break; default: ! do_log(LT_ERR, NOTHING, NOTHING, "Unknown type on #%d in free_object.", thing); return; } --- 596,602 ---- clear_room(thing); break; default: ! do_rawlog(LT_ERR, "Unknown type on #%d in free_object.", thing); return; } *************** *** 625,638 **** /* Huh. An exit that claims to be from here, but wasn't linked * in properly. */ do_rawlog(LT_ERR, ! "ERROR: Exit %s leading from invalid room #%d destroyed.", unparse_object(GOD, i), thing); free_object(i); break; case TYPE_ROOM: /* Hrm. It claims we're an exit from it, but we didn't agree. * Clean it up anyway. */ ! do_log(LT_ERR, NOTHING, NOTHING, "Found a destroyed exit #%d in room #%d", thing, i); break; } --- 625,638 ---- /* Huh. An exit that claims to be from here, but wasn't linked * in properly. */ do_rawlog(LT_ERR, ! "Exit %s leading from invalid room #%d destroyed.", unparse_object(GOD, i), thing); free_object(i); break; case TYPE_ROOM: /* Hrm. It claims we're an exit from it, but we didn't agree. * Clean it up anyway. */ ! do_rawlog(LT_ERR, "Found a destroyed exit #%d in room #%d", thing, i); break; } *************** *** 856,867 **** if (nrecur++ == 20) { first_free = NOTHING; report(); ! do_rawlog(LT_ERR, "ERROR: Removed free list and continued\n"); return (NOTHING); } report(); ! do_rawlog(LT_TRACE, "ERROR: Object #%d should not be free\n", newobj); ! do_rawlog(LT_TRACE, "ERROR: Corrupt free list, fixing\n"); fix_free_list(); temp = free_get(); nrecur--; --- 856,867 ---- if (nrecur++ == 20) { first_free = NOTHING; report(); ! do_rawlog(LT_ERR, "Removed free list and continued"); return (NOTHING); } report(); ! do_rawlog(LT_TRACE, "Object #%d should not be free", newobj); ! do_rawlog(LT_TRACE, "Corrupt free list, fixing"); fix_free_list(); temp = free_get(); nrecur--; *************** *** 954,960 **** dbref next; next = Next(thing); if ((!GoodObject(next) || !IsGarbage(next)) && (next != NOTHING)) { ! do_rawlog(LT_ERR, "ERROR: Invalid next pointer #%d from object %s", next, unparse_object(GOD, thing)); Next(thing) = NOTHING; fix_free_list(); --- 954,960 ---- dbref next; next = Next(thing); if ((!GoodObject(next) || !IsGarbage(next)) && (next != NOTHING)) { ! do_rawlog(LT_ERR, "Invalid next pointer #%d from object %s", next, unparse_object(GOD, thing)); Next(thing) = NOTHING; fix_free_list(); *************** *** 971,984 **** Parent(thing) = NOTHING; owner = Owner(thing); if (!GoodObject(owner) || IsGarbage(owner) || !IsPlayer(owner)) { ! do_rawlog(LT_ERR, "ERROR: Invalid object owner on %s(%d)", Name(thing), thing); report(); Owner(thing) = GOD; } next = Next(thing); if ((!GoodObject(next) || IsGarbage(next)) && (next != NOTHING)) { ! do_rawlog(LT_ERR, "ERROR: Invalid next pointer #%d from object %s", next, unparse_object(GOD, thing)); Next(thing) = NOTHING; } --- 971,984 ---- Parent(thing) = NOTHING; owner = Owner(thing); if (!GoodObject(owner) || IsGarbage(owner) || !IsPlayer(owner)) { ! do_rawlog(LT_ERR, "Invalid object owner on %s(%d)", Name(thing), thing); report(); Owner(thing) = GOD; } next = Next(thing); if ((!GoodObject(next) || IsGarbage(next)) && (next != NOTHING)) { ! do_rawlog(LT_ERR, "Invalid next pointer #%d from object %s", next, unparse_object(GOD, thing)); Next(thing) = NOTHING; } *************** *** 1000,1006 **** /* Eww.. Exits can't have contents. Bad news */ Contents(thing) = NOTHING; do_rawlog(LT_ERR, ! "ERROR: Exit %s has a contents list. Wiping it out.", unparse_object(GOD, thing)); } if (!GoodObject(loc) --- 1000,1006 ---- /* Eww.. Exits can't have contents. Bad news */ Contents(thing) = NOTHING; do_rawlog(LT_ERR, ! "Exit %s has a contents list. Wiping it out.", unparse_object(GOD, thing)); } if (!GoodObject(loc) *************** *** 1010,1016 **** */ Destination(thing) = Source(thing); do_rawlog(LT_ERR, ! "ERROR: Exit %s leading to invalid room #%d relinked to its source room.", unparse_object(GOD, thing), home); } else if (GoodObject(loc) && IsGarbage(loc)) { /* If our destination is destroyed, then we relink to the --- 1010,1016 ---- */ Destination(thing) = Source(thing); do_rawlog(LT_ERR, ! "Exit %s leading to invalid room #%d relinked to its source room.", unparse_object(GOD, thing), home); } else if (GoodObject(loc) && IsGarbage(loc)) { /* If our destination is destroyed, then we relink to the *************** *** 1021,1034 **** */ Destination(thing) = Source(thing); do_rawlog(LT_ERR, ! "ERROR: Exit %s leading to garbage room #%d relinked to its source room.", unparse_object(GOD, thing), home); } /* This must come last */ if (!GoodObject(home) || !IsRoom(home)) { /* If our source is destroyed, just destroy the exit. */ do_rawlog(LT_ERR, ! "ERROR: Exit %s leading from invalid room #%d destroyed.", unparse_object(GOD, thing), home); free_object(thing); } --- 1021,1034 ---- */ Destination(thing) = Source(thing); do_rawlog(LT_ERR, ! "Exit %s leading to garbage room #%d relinked to its source room.", unparse_object(GOD, thing), home); } /* This must come last */ if (!GoodObject(home) || !IsRoom(home)) { /* If our source is destroyed, just destroy the exit. */ do_rawlog(LT_ERR, ! "Exit %s leading from invalid room #%d destroyed.", unparse_object(GOD, thing), home); free_object(thing); } *************** *** 1036,1042 **** case TYPE_ROOM: if (GoodObject(home) && IsGarbage(home)) { /* Eww. Destroyed exit. This isn't supposed to happen. */ ! do_log(LT_ERR, NOTHING, NOTHING, "Found a destroyed exit #%d in room #%d", home, thing); } if (GoodObject(loc) && (IsGarbage(loc) || IsExit(loc))) { --- 1036,1042 ---- case TYPE_ROOM: if (GoodObject(home) && IsGarbage(home)) { /* Eww. Destroyed exit. This isn't supposed to happen. */ ! do_rawlog(LT_ERR, "Found a destroyed exit #%d in room #%d", home, thing); } if (GoodObject(loc) && (IsGarbage(loc) || IsExit(loc))) { *************** *** 1097,1103 **** else if (IsRoom(loc)) { if (!Floating(loc) && (!EXITS_CONNECT_ROOMS || (Exits(loc) == NOTHING))) { if (!Name(loc)) { ! do_log(LT_ERR, NOTHING, NOTHING, "ERROR: no name for room #%d.", loc); SET(Name(loc), "XXXX"); } notify(Owner(loc), tprintf("You own a disconnected room, %s", --- 1097,1103 ---- else if (IsRoom(loc)) { if (!Floating(loc) && (!EXITS_CONNECT_ROOMS || (Exits(loc) == NOTHING))) { if (!Name(loc)) { ! do_rawlog(LT_ERR, "no name for room #%d.", loc); SET(Name(loc), "XXXX"); } notify(Owner(loc), tprintf("You own a disconnected room, %s", *************** *** 1229,1238 **** break; case TYPE_ROOM: /* We should never get here. */ ! do_log(LT_ERR, NOTHING, NOTHING, "Disconnected room. So what?"); break; default: ! do_log(LT_ERR, NOTHING, NOTHING, "Surprising type on #%d found in check_cycles.", thing); break; } --- 1229,1238 ---- break; case TYPE_ROOM: /* We should never get here. */ ! do_rawlog(LT_ERR, "Disconnected room. So what?"); break; default: ! do_rawlog(LT_ERR, "Surprising type on #%d found in check_cycles.", thing); break; } *************** *** 1257,1263 **** for (thing = Contents(loc); thing != NOTHING; thing = Next(thing)) { if (!Mobile(thing)) { do_rawlog(LT_ERR, ! "ERROR: Contents of object %d corrupt at object %d cleared", loc, thing); /* Remove this from the list and start over. */ Contents(loc) = remove_first(Contents(loc), thing); --- 1257,1263 ---- for (thing = Contents(loc); thing != NOTHING; thing = Next(thing)) { if (!Mobile(thing)) { do_rawlog(LT_ERR, ! "Contents of object %d corrupt at object %d cleared", loc, thing); /* Remove this from the list and start over. */ Contents(loc) = remove_first(Contents(loc), thing); *************** *** 1280,1286 **** for (thing = Exits(loc); thing != NOTHING; thing = Next(thing)) { if (!IsExit(thing)) { do_rawlog(LT_ERR, ! "ERROR: Exits of room %d corrupt at object %d cleared", loc, thing); /* Remove this from the list and start over. */ Exits(loc) = remove_first(Exits(loc), thing); --- 1280,1286 ---- for (thing = Exits(loc); thing != NOTHING; thing = Next(thing)) { if (!IsExit(thing)) { do_rawlog(LT_ERR, ! "Exits of room %d corrupt at object %d cleared", loc, thing); /* Remove this from the list and start over. */ Exits(loc) = remove_first(Exits(loc), thing); *************** *** 1300,1306 **** if (Marked(thing)) Flags(thing) &= ~MARKED; else if (Mobile(thing)) { ! do_rawlog(LT_ERR, "ERROR DBCK: Moved object %d", thing); moveto(thing, PLAYER_START); } } --- 1300,1306 ---- if (Marked(thing)) Flags(thing) &= ~MARKED; else if (Mobile(thing)) { ! do_rawlog(LT_ERR, "DBCK: Moved object %d", thing); moveto(thing, PLAYER_START); } } *** /usr/local/mu/pennmush/src/extchat.c Mon Jul 17 10:59:53 2000 --- src/extchat.c Tue Jul 18 09:07:47 2000 *************** *** 61,67 **** #define remove_user_by_dbref(who,chan) \ remove_user(onchannel(who,chan),chan) ! int num_channels; CHAN *channels; --- 61,67 ---- #define remove_user_by_dbref(who,chan) \ remove_user(onchannel(who,chan),chan) ! int num_channels=0; CHAN *channels; *************** *** 142,148 **** if (!ch) break; if (!load_channel(fp, ch)) { ! fprintf(stderr, "Unable to load channel %d.", i); free_channel(ch); break; } --- 142,148 ---- if (!ch) break; if (!load_channel(fp, ch)) { ! do_rawlog(LT_ERR, "Unable to load channel %d.", i); free_channel(ch); break; } *************** *** 286,292 **** num++; } else { /* But be sure to read (and discard) the player's info */ ! do_log(LT_ERR, 0, 0, "Bad object #%d removed from channel %s", player, ChanName(ch)); (void) getref(fp); (void) getstring_noalloc(fp); --- 286,292 ---- num++; } else { /* But be sure to read (and discard) the player's info */ ! do_rawlog(LT_ERR, "Bad object #%d removed from channel %s", player, ChanName(ch)); (void) getref(fp); (void) getstring_noalloc(fp); *** /usr/local/mu/pennmush/src/extmail.c Mon Jul 17 10:59:53 2000 --- src/extmail.c Tue Jul 18 09:07:47 2000 *************** *** 1126,1132 **** HEAD = TAIL = NULL; mdb_top = 0; ! do_log(LT_ERR, 0, 0, "** MAIL PURGE ** done by %s(#%d).", Name(player), player); notify(player, "You annihilate the post office. All messages cleared."); } --- 1126,1132 ---- HEAD = TAIL = NULL; mdb_top = 0; ! do_rawlog(LT_NOTICE, "** MAIL PURGE ** done by %s(#%d).", Name(player), player); notify(player, "You annihilate the post office. All messages cleared."); } *************** *** 1873,1879 **** fflush(fp); if (count != mdb_top) { ! do_log(LT_ERR, 0, 0, "MAIL: Count of messages is %d, mdb_top is %d.", count, mdb_top); /* mdb_top = count; */ /* Removed since it won't make a difference unless the process isn't forked */ --- 1873,1879 ---- fflush(fp); if (count != mdb_top) { ! do_rawlog(LT_ERR, "MAIL: Count of messages is %d, mdb_top is %d.", count, mdb_top); /* mdb_top = count; */ /* Removed since it won't make a difference unless the process isn't forked */ *************** *** 2061,2067 **** } if (!done) { /* This is bad */ ! fprintf(stderr, "MAIL: bad code.\n"); } } } --- 2061,2067 ---- } if (!done) { /* This is bad */ ! do_rawlog(LT_ERR, "MAIL: bad code."); } } } *************** *** 2070,2076 **** mdb_top = i; if (i != mail_top) { ! fprintf(stderr, "MAIL: mail_top is %d, only read in %d messages.\n", mail_top, i); } do_mail_debug(GOD, (char *) "fix", (char *) ""); --- 2070,2076 ---- mdb_top = i; if (i != mail_top) { ! do_rawlog(LT_ERR, "MAIL: mail_top is %d, only read in %d messages.", mail_top, i); } do_mail_debug(GOD, (char *) "fix", (char *) ""); *************** *** 2276,2282 **** msgtm = (struct tm *) malloc(sizeof(struct tm)); if (!msgtm) { /* Ugly malloc failure */ ! do_log(LT_ERR, 0, 0, "MAIL: Couldn't malloc struct tm!"); return 0; } strcpy(msgtimestr, (char *) uncompress(mp->time)); --- 2276,2282 ---- msgtm = (struct tm *) malloc(sizeof(struct tm)); if (!msgtm) { /* Ugly malloc failure */ ! do_rawlog(LT_ERR, "MAIL: Couldn't malloc struct tm!"); return 0; } strcpy(msgtimestr, (char *) uncompress(mp->time)); *** /usr/local/mu/pennmush/src/flags.c Mon Jul 17 10:59:53 2000 --- src/flags.c Tue Jul 18 09:07:47 2000 *************** *** 542,549 **** if ((f = flag_hash_lookup(a->realname)) != NULL) flag_hash_insert(a->alias, (FLAG *) f); else ! fprintf(stderr, ! "FLAG INIT: flag alias %s matches no known flag.\n", a->alias); } } --- 542,549 ---- if ((f = flag_hash_lookup(a->realname)) != NULL) flag_hash_insert(a->alias, (FLAG *) f); else ! do_rawlog(LT_ERR, ! "FLAG INIT: flag alias %s matches no known flag.", a->alias); } } *** /usr/local/mu/pennmush/src/fundb.c Mon Jul 17 10:59:53 2000 --- src/fundb.c Tue Jul 18 09:07:47 2000 *************** *** 850,856 **** break; default: safe_str("WEIRD OBJECT", buff, bp); ! do_rawlog(LT_ERR, "WARNING: Weird object #%d (type %d)\n", it, Typeof(it)); } } --- 850,856 ---- break; default: safe_str("WEIRD OBJECT", buff, bp); ! do_rawlog(LT_ERR, "Weird object #%d (type %d)", it, Typeof(it)); } } *** /usr/local/mu/pennmush/src/game.c Mon Jul 17 10:59:53 2000 --- src/game.c Tue Jul 18 09:07:47 2000 *************** *** 182,197 **** notify(player, tprintf("Paranoid dumping, checkpoint interval %d.", paranoid_checkpt)); do_rawlog(LT_CHECK, ! "*** PARANOID DUMP *** done by %s(#%d),\n", Name(player), player); } else { notify(player, tprintf("Debug dumping, checkpoint interval %d.", paranoid_checkpt)); do_rawlog(LT_CHECK, ! "*** DEBUG DUMP *** done by %s(#%d),\n", Name(player), player); } ! do_rawlog(LT_CHECK, "\tcheckpoint interval %d, at %s", paranoid_checkpt, ctime(&tt)); } else { /* normal dump */ --- 182,197 ---- notify(player, tprintf("Paranoid dumping, checkpoint interval %d.", paranoid_checkpt)); do_rawlog(LT_CHECK, ! "*** PARANOID DUMP *** done by %s(#%d),", Name(player), player); } else { notify(player, tprintf("Debug dumping, checkpoint interval %d.", paranoid_checkpt)); do_rawlog(LT_CHECK, ! "*** DEBUG DUMP *** done by %s(#%d),", Name(player), player); } ! do_rawlog(LT_CHECK, " checkpoint interval %d, at %s", paranoid_checkpt, ctime(&tt)); } else { /* normal dump */ *************** *** 213,222 **** report() { if (GoodObject(cplr)) ! do_rawlog(LT_TRACE, "TRACE: Cmd:%s\tdepth:%d\tby #%d at #%d", ccom, depth, cplr, Location(cplr)); else ! do_rawlog(LT_TRACE, "TRACE: Cmd:%s\tdepth:%d\tby #%d", ccom, depth, cplr); } #ifdef HAS_GETRUSAGE --- 213,222 ---- report() { if (GoodObject(cplr)) ! do_rawlog(LT_TRACE, "Cmd:%s depth:%d by #%d at #%d", ccom, depth, cplr, Location(cplr)); else ! do_rawlog(LT_TRACE, "Cmd:%s depth:%d by #%d", ccom, depth, cplr); } #ifdef HAS_GETRUSAGE *************** *** 271,277 **** } if (Wizard(player)) { flag_broadcast(0, 0, "GAME: Shutdown by %s", Name(player)); ! do_log(LT_ERR, player, NOTHING, "SHUTDOWN by %s\n", unparse_object(player, player)); /* This will create a file used to check if a restart should occur */ --- 271,277 ---- } if (Wizard(player)) { flag_broadcast(0, 0, "GAME: Shutdown by %s", Name(player)); ! do_log(LT_NOTICE, player, NOTHING, "SHUTDOWN by %s", unparse_object(player, player)); /* This will create a file used to check if a restart should occur */ *************** *** 383,389 **** FILE *f; int i; ! fprintf(stderr, "PANIC: %s\n", message); report(); flag_broadcast(0, 0, "EMERGENCY SHUTDOWN: %s", message); --- 383,389 ---- FILE *f; int i; ! do_rawlog(LT_PANIC, "PANIC: %s", message); report(); flag_broadcast(0, 0, "EMERGENCY SHUTDOWN: %s", message); *************** *** 400,406 **** perror("CANNOT OPEN PANIC FILE, YOU LOSE"); _exit(135); } else { ! fprintf(stderr, "DUMPING: %s\n", panicfile); db_write(f, DBF_PANIC); #ifdef USE_MAILER dump_mail(f); --- 400,406 ---- perror("CANNOT OPEN PANIC FILE, YOU LOSE"); _exit(135); } else { ! do_rawlog(LT_CHECK, "DUMPING: %s", panicfile); db_write(f, DBF_PANIC); #ifdef USE_MAILER dump_mail(f); *************** *** 409,415 **** save_chatdb(f); #endif fclose(f); ! fprintf(stderr, "DUMPING: %s (done)\n", panicfile); _exit(136); } } --- 409,415 ---- save_chatdb(f); #endif fclose(f); ! do_rawlog(LT_CHECK, "DUMPING: %s (done)", panicfile); _exit(136); } } *************** *** 419,427 **** { epoch++; ! do_rawlog(LT_ERR, "DUMPING: %s.#%d#\n", dumpfile, epoch); dump_database_internal(); ! do_rawlog(LT_ERR, "DUMPING: %s.#%d# (done)\n", dumpfile, epoch); } #ifndef macintosh --- 419,427 ---- { epoch++; ! do_rawlog(LT_CHECK, "DUMPING: %s.#%d#", dumpfile, epoch); dump_database_internal(); ! do_rawlog(LT_CHECK, "DUMPING: %s.#%d# (done)", dumpfile, epoch); } #ifndef macintosh *************** *** 461,467 **** int child, nofork; epoch++; ! do_rawlog(LT_CHECK, "CHECKPOINTING: %s.#%d#\n", dumpfile, epoch); if (NO_FORK) nofork = 1; else --- 461,467 ---- int child, nofork; epoch++; ! do_rawlog(LT_CHECK, "CHECKPOINTING: %s.#%d#", dumpfile, epoch); if (NO_FORK) nofork = 1; else *************** *** 478,484 **** child = fork(); if (child < 0) { /* Oops, fork failed. Let's do a nofork dump */ ! do_log(LT_ERR, 0, 0, "fork_and_dump: fork() failed! Dumping nofork instead."); if (DUMP_NOFORK_MESSAGE && *DUMP_NOFORK_MESSAGE) flag_broadcast(0, 0, DUMP_NOFORK_MESSAGE); --- 478,484 ---- child = fork(); if (child < 0) { /* Oops, fork failed. Let's do a nofork dump */ ! do_rawlog(LT_ERR, "fork_and_dump: fork() failed! Dumping nofork instead."); if (DUMP_NOFORK_MESSAGE && *DUMP_NOFORK_MESSAGE) flag_broadcast(0, 0, DUMP_NOFORK_MESSAGE); *************** *** 571,577 **** if (IsGarbage(thing)) SET(Name(thing), "Garbage"); else { ! do_log(LT_ERR, NOTHING, NOTHING, "Null name on object #%d", thing); SET(Name(thing), "XXXX"); } } --- 571,577 ---- if (IsGarbage(thing)) SET(Name(thing), "Garbage"); else { ! do_rawlog(LT_ERR, "Null name on object #%d", thing); SET(Name(thing), "XXXX"); } } *************** *** 605,612 **** start_time = time((time_t *) 0); if (!first_start_time) first_start_time = start_time; ! fprintf(stderr, "%s\n", VERSION); ! fprintf(stderr, "MUSH restarted, PID %d, at %s\n", (int) getpid(), ctime(&start_time)); /* initialize all the hash tables: flags, functions, and attributes. */ --- 605,612 ---- start_time = time((time_t *) 0); if (!first_start_time) first_start_time = start_time; ! do_rawlog(LT_NOTICE, "%s", VERSION); ! do_rawlog(LT_NOTICE, "MUSH restarted, PID %d, at %s", (int) getpid(), ctime(&start_time)); /* initialize all the hash tables: flags, functions, and attributes. */ *************** *** 647,658 **** f = db_open(infile); /* ok, read it in */ ! fprintf(stderr, "ANALYZING: %s\n", infile); if (init_compress(f) < 0) { ! fprintf(stderr, "ERROR LOADING\n"); return -1; } ! fprintf(stderr, "ANALYZING: %s (done)\n", infile); /* everything ok */ db_close(f); --- 647,658 ---- f = db_open(infile); /* ok, read it in */ ! do_rawlog(LT_CHECK, "ANALYZING: %s", infile); if (init_compress(f) < 0) { ! do_rawlog(LT_PANIC, "ERROR LOADING %s", infile); return -1; } ! do_rawlog(LT_CHECK, "ANALYZING: %s (done)", infile); /* everything ok */ db_close(f); *************** *** 662,673 **** return -1; /* ok, read it in */ ! fprintf(stderr, "LOADING: %s\n", infile); if (db_read(f) < 0) { ! fprintf(stderr, "ERROR LOADING\n"); return -1; } ! fprintf(stderr, "LOADING: %s (done)\n", infile); /* If there's stuff at the end of the db, we may have a panic * format db, with everything shoved together. In that case, --- 662,673 ---- return -1; /* ok, read it in */ ! do_rawlog(LT_CHECK, "LOADING: %s", infile); if (db_read(f) < 0) { ! do_rawlog(LT_PANIC, "ERROR LOADING %s", infile); return -1; } ! do_rawlog(LT_CHECK, "LOADING: %s (done)", infile); /* If there's stuff at the end of the db, we may have a panic * format db, with everything shoved together. In that case, *************** *** 681,697 **** /* complain about bad config options */ if (!GoodObject(PLAYER_START) || (!IsRoom(PLAYER_START))) ! fprintf(stderr, "WARNING: Player_start (#%d) is NOT a room.\n", PLAYER_START); if (DO_GLOBALS && (!GoodObject(MASTER_ROOM) || (!IsRoom(MASTER_ROOM)))) ! fprintf(stderr, "WARNING: Master room (#%d) is NOT a room.\n", MASTER_ROOM); #ifdef USE_MAILER /* read mail database */ if (panicdb) { ! fprintf(stderr, "LOADING: Trying to get mail from %s\n", infile); if (load_mail(f) <= 0) { ! fprintf(stderr, "FAILED: Reverting to normal maildb\n"); db_close(f); panicdb = 0; } --- 681,697 ---- /* complain about bad config options */ if (!GoodObject(PLAYER_START) || (!IsRoom(PLAYER_START))) ! do_rawlog(LT_CONFIG, "Player_start (#%d) is NOT a room.", PLAYER_START); if (DO_GLOBALS && (!GoodObject(MASTER_ROOM) || (!IsRoom(MASTER_ROOM)))) ! do_rawlog(LT_CONFIG, "Master room (#%d) is NOT a room.", MASTER_ROOM); #ifdef USE_MAILER /* read mail database */ if (panicdb) { ! do_rawlog(LT_CHECK, "LOADING: Trying to get mail from %s", infile); if (load_mail(f) <= 0) { ! do_rawlog(LT_CHECK, "FAILED: Reverting to normal maildb"); db_close(f); panicdb = 0; } *************** *** 703,711 **** if (f == NULL) { mail_init(); } else { ! fprintf(stderr, "LOADING: %s\n", mailfile); load_mail(f); ! fprintf(stderr, "LOADING: %s (done)\n", mailfile); db_close(f); } } --- 703,711 ---- if (f == NULL) { mail_init(); } else { ! do_rawlog(LT_CHECK, "LOADING: %s", mailfile); load_mail(f); ! do_rawlog(LT_CHECK, "LOADING: %s (done)", mailfile); db_close(f); } } *************** *** 715,723 **** init_chatdb(); if (panicdb) { ! fprintf(stderr, "LOADING: Trying to get chat from %s\n", infile); if (load_chatdb(f)) { ! fprintf(stderr, "FAILED: Reverting to normal chatdb\n"); db_close(f); panicdb = 0; } --- 715,723 ---- init_chatdb(); if (panicdb) { ! do_rawlog(LT_CHECK, "LOADING: Trying to get chat from %s", infile); if (load_chatdb(f)) { ! do_rawlog(LT_CHECK, "FAILED: Reverting to normal chatdb"); db_close(f); panicdb = 0; } *************** *** 725,736 **** if (!panicdb) { f = db_open(options.chatdb); if (f) { ! fprintf(stderr, "LOADING: %s\n", options.chatdb); if (load_chatdb(f)) { ! fprintf(stderr, "LOADING: %s (done)\n", options.chatdb); db_close(f); } else { ! fprintf(stderr, "ERROR LOADING %s\n", options.chatdb); db_close(f); return -1; } --- 725,736 ---- if (!panicdb) { f = db_open(options.chatdb); if (f) { ! do_rawlog(LT_CHECK, "LOADING: %s", options.chatdb); if (load_chatdb(f)) { ! do_rawlog(LT_CHECK, "LOADING: %s (done)", options.chatdb); db_close(f); } else { ! do_rawlog(LT_CHECK, "ERROR LOADING %s", options.chatdb); db_close(f); return -1; } *************** *** 831,842 **** depth = 0; if (!command) { ! do_log(LT_ERR, NOTHING, NOTHING, "ERROR: No command!!!"); return; } /* robustify player */ if (!GoodObject(player)) { ! do_log(LT_ERR, NOTHING, NOTHING, "process_command bad player #%d", player); return; } gagged = IS(Owner(player), TYPE_PLAYER, PLAYER_GAGGED); --- 831,842 ---- depth = 0; if (!command) { ! do_rawlog(LT_ERR, "ERROR: No command!!!"); return; } /* robustify player */ if (!GoodObject(player)) { ! do_rawlog(LT_ERR, "process_command bad player #%d", player); return; } gagged = IS(Owner(player), TYPE_PLAYER, PLAYER_GAGGED); *************** *** 859,865 **** notify(Owner(player), tprintf("Invalid location on command execution: %s(#%d)", Name(player), player)); ! do_log(LT_ERR, NOTHING, NOTHING, "Command attempted by %s(#%d) in invalid location #%d.", Name(player), player, Location(player)); moveto(player, PLAYER_START); /* move it someplace valid */ --- 859,865 ---- notify(Owner(player), tprintf("Invalid location on command execution: %s(#%d)", Name(player), player)); ! do_rawlog(LT_ERR, "Command attempted by %s(#%d) in invalid location #%d.", Name(player), player, Location(player)); moveto(player, PLAYER_START); /* move it someplace valid */ *************** *** 871,878 **** * player = Owner(player); */ orator = player; ! if (options.log_commands || Suspect(player)) ! do_log(LT_CMD, player, 0, "%s", command); if Verbose (player) --- 871,880 ---- * player = Owner(player); */ orator = player; ! if (Suspect(player)) ! do_log(LT_SUSPECT, player, 0, "%s", command); ! ! do_log(LT_CMD, player, 0, "%s", command); if Verbose (player) *************** *** 998,1005 **** } /* end of special checks */ if (!a) { notify(player, "Huh? (Type \"help\" for help.)"); ! if (options.log_huhs) ! do_log(LT_HUH, player, 0, "%s", unp); } } /* command has been executed. Free up memory. */ --- 1000,1006 ---- } /* end of special checks */ if (!a) { notify(player, "Huh? (Type \"help\" for help.)"); ! do_log(LT_HUH, player, 0, "%s", unp); } } /* command has been executed. Free up memory. */ *************** *** 1179,1185 **** notify(player, "Permission denied."); return; } ! do_rawlog(ltype, "LOG: %s(#%d%s): %s", Name(player), player, unparse_flags(player, GOD), str); notify(player, "Logged."); --- 1180,1186 ---- notify(player, "Permission denied."); return; } ! do_rawlog(ltype, "LOG:%s(#%d%s): %s", Name(player), player, unparse_flags(player, GOD), str); notify(player, "Logged."); *************** *** 1465,1471 **** /* just in case the system is screwy */ if (fp == NULL) { notify(player, "Error -- cannot execute uptime."); ! fprintf(stderr, "** ERROR ** popen for @uptime returned NULL."); return; } /* print system uptime */ --- 1466,1472 ---- /* just in case the system is screwy */ if (fp == NULL) { notify(player, "Error -- cannot execute uptime."); ! do_rawlog(LT_ERR, "** ERROR ** popen for @uptime returned NULL."); return; } /* print system uptime */ *** /usr/local/mu/pennmush/src/lock.c Mon Jul 17 10:59:53 2000 --- src/lock.c Tue Jul 18 09:07:47 2000 *************** *** 180,186 **** ll = (lock_list *) mush_malloc(sizeof(lock_list), "lock_list"); if (!ll) { /* Oh, this sucks */ ! do_log(LT_ERR, 0, 0, "Unable to malloc memory for lock_list!"); } else { real_type = match_lock(type); if (real_type == NULL) { --- 180,186 ---- ll = (lock_list *) mush_malloc(sizeof(lock_list), "lock_list"); if (!ll) { /* Oh, this sucks */ ! do_rawlog(LT_ERR, "Unable to malloc memory for lock_list!"); } else { real_type = match_lock(type); if (real_type == NULL) { *** /usr/local/mu/pennmush/src/log.c Mon Jul 17 10:59:53 2000 --- src/log.c Tue Jul 18 09:07:47 2000 *************** *** 31,48 **** #include "intrface.h" #include "confmagic.h" char *quick_unparse _((dbref object)); void start_log _((FILE ** fp, const char *filename)); void end_log _((FILE * fp)); void WIN32_CDECL do_rawlog _((int logtype, const char *fmt, ...)); /* log file pointers */ ! FILE *connlog_fp; ! FILE *checklog_fp; ! FILE *wizlog_fp; ! FILE *tracelog_fp; ! FILE *cmdlog_fp; char * quick_unparse(object) --- 31,53 ---- #include "intrface.h" #include "confmagic.h" + #ifndef WIN32 + #include + #endif + char *quick_unparse _((dbref object)); void start_log _((FILE ** fp, const char *filename)); void end_log _((FILE * fp)); void WIN32_CDECL do_rawlog _((int logtype, const char *fmt, ...)); + void reopen_logs _((void)); + /* log file pointers */ ! FILE *log_fps[16]; + /* I am aware you can log to syslog without opening it first. + * It's just really confusing with more then one MUSH. */ + int syslog_open=0; char * quick_unparse(object) *************** *** 75,81 **** { *fp = fopen(filename, "a"); if (*fp == NULL) { ! fprintf(stderr, "WARNING: cannot open log %s\n", filename); *fp = stderr; } fprintf(*fp, "START OF LOG.\n"); --- 80,86 ---- { *fp = fopen(filename, "a"); if (*fp == NULL) { ! do_rawlog(LT_ERR, "WARNING: cannot open log %s", filename); *fp = stderr; } fprintf(*fp, "START OF LOG.\n"); *************** *** 85,99 **** void start_all_logs() { ! #ifndef SINGLE_LOGFILE ! start_log(&connlog_fp, CONNLOG); ! start_log(&checklog_fp, CHECKLOG); ! start_log(&wizlog_fp, WIZLOG); ! start_log(&tracelog_fp, TRACELOG); ! start_log(&cmdlog_fp, CMDLOG); ! #else ! connlog_fp = checklog_fp = wizlog_fp = tracelog_fp = cmdlog_fp = stderr; ! #endif /* SINGLE_LOGFILE */ } void --- 90,131 ---- void start_all_logs() { ! int i; ! int use_syslog=0; ! log_fps[0]=stderr; ! ! do_rawlog(LT_NOTICE, "Redirecting output to: %s", LOGFILE(0)); ! ! if (!freopen(LOGFILE(0), "a", stderr)) { ! printf("Ack! Failed reopening stderr! Abort! Abort!"); ! exit(1); ! } ! do_rawlog(LT_NOTICE, "Output redirected from stderr."); ! ! for(i=1; i < 16; i++) { ! options.is_logged[i]=0; ! if (strcasecmp(LOGFILE(i), "none")) { ! start_log(&log_fps[i], LOGFILE(i)); ! options.is_logged[i]=options.is_logged[i] |= LOG_TO_FILE; ! } else { ! log_fps[i]=NULL; ! } ! #ifndef WIN32 ! if ((USE_SYSLOG) && (options.log_level[i] > -1)) ! options.is_logged[i]=options.is_logged[i] |= LOG_TO_SYSLOG; ! #endif ! if (options.use_chanlog && (strcasecmp(options.log_channel[i], "none"))) ! options.is_logged[i]=options.is_logged[i] |= LOG_TO_CHANNEL; ! } ! ! #ifndef WIN32 ! if (USE_SYSLOG) { ! do_rawlog(LT_NOTICE, "Opening syslog"); ! openlog(options.syslog_name, LOG_PID , LOG_USER); ! syslog_open=1; ! do_rawlog(LT_NOTICE, "Syslog opened."); ! } ! #endif } void *************** *** 104,125 **** fprintf(fp, "END OF LOG.\n"); fflush(fp); fclose(fp); } } void end_all_logs() { ! #ifndef SINGLE_LOGFILE /* close up the log files */ ! end_log(connlog_fp); ! end_log(checklog_fp); ! end_log(wizlog_fp); ! end_log(tracelog_fp); ! end_log(cmdlog_fp); ! #endif /* SINGLE_LOGFILE */ } #ifdef I_STDARG void WIN32_CDECL --- 136,179 ---- fprintf(fp, "END OF LOG.\n"); fflush(fp); fclose(fp); + fp=NULL; } } void end_all_logs() { ! int i; /* close up the log files */ ! for(i=1; i < 16; i++) ! if (options.is_logged[i] & LOG_TO_FILE) { ! end_log(log_fps[i]); ! options.is_logged[i] &= ~(LOG_TO_SYSLOG); ! } ! ! #ifndef WIN32 ! if (syslog_open) { ! do_rawlog(LT_NOTICE, "Closing syslog"); ! closelog(); ! for(i=1; i < 16; i++) ! options.is_logged[i] &= ~(LOG_TO_SYSLOG); ! syslog_open=0; ! do_rawlog(LT_NOTICE, "Syslog closed."); ! } ! #endif ! } + void + start_errlog() + { + int i; + for(i=0; i < 16; i++) { + log_fps[i]=stderr; + options.is_logged[i]=1; + } + + } #ifdef I_STDARG void WIN32_CDECL *************** *** 138,146 **** time_t tt; struct tm *ttm; char timebuf[16]; ! char tbuf1[BUFFER_LEN + 50]; va_list args; FILE *f = NULL; #ifndef I_STDARG char *fmt; --- 192,202 ---- time_t tt; struct tm *ttm; char timebuf[16]; ! char tbuf1[BUFFER_LEN + 47]; ! char typebuf[10]; va_list args; FILE *f = NULL; + int syslog_pri=LOG_INFO; #ifndef I_STDARG char *fmt; *************** *** 152,157 **** --- 208,216 ---- (void) vsprintf(tbuf1, fmt, args); va_end(args); + if (!options.is_logged[logtype]) + return; + time(&tt); ttm = localtime(&tt); sprintf(timebuf, "%d%d/%d%d %d%d:%d%d:%d%d", *************** *** 163,194 **** switch (logtype) { case LT_ERR: ! f = stderr; break; case LT_CMD: ! f = cmdlog_fp; break; case LT_WIZ: ! f = wizlog_fp; break; case LT_CONN: ! f = connlog_fp; break; case LT_TRACE: ! f = tracelog_fp; break; case LT_CHECK: ! f = checklog_fp; break; case LT_HUH: ! f = cmdlog_fp; break; ! default: ! f = stderr; break; } ! fprintf(f, "%s %s\n", timebuf, tbuf1); ! fflush(f); } #ifdef I_STDARG --- 222,291 ---- switch (logtype) { case LT_ERR: ! sprintf(typebuf, "RPT"); break; case LT_CMD: ! sprintf(typebuf, "CMD"); break; case LT_WIZ: ! sprintf(typebuf, "WIZ"); break; case LT_CONN: ! sprintf(typebuf, "NET"); break; case LT_TRACE: ! sprintf(typebuf, "TRACE"); break; case LT_CHECK: ! sprintf(typebuf, "CHK"); break; case LT_HUH: ! sprintf(typebuf, "HUH"); break; ! case LT_SUSPECT: ! sprintf(typebuf, "SUSPECT"); ! break; ! case LT_NOTICE: ! sprintf(typebuf, "NOTE"); ! break; ! case LT_CONFIG: ! sprintf(typebuf, "CONFIG"); ! break; ! case LT_PANIC: ! sprintf(typebuf, "PANIC"); break; + case LT_DEBUG: + sprintf(typebuf, "DEBUG"); + break; + case LT_USER1: + sprintf(typebuf, "USER1"); + break; + case LT_USER2: + sprintf(typebuf, "USER2"); + break; + case LT_USER3: + sprintf(typebuf, "USER3"); + break; + } + + if ((options.is_logged[logtype] & LOG_TO_SYSLOG) && syslog_open) + syslog(options.log_level[logtype], "%s: %s", typebuf, tbuf1); + + if ((num_channels > 0 ) && (options.is_logged[logtype] & LOG_TO_CHANNEL)) { + CHAN *chan = NULL; + if (find_channel(options.log_channel[logtype], &chan)) + channel_broadcast(chan, 0, 0, "<%s> %s %s: %s", + ChanName(chan), timebuf, typebuf, tbuf1); } ! ! if (options.is_logged[logtype] & LOG_TO_FILE) { ! f = log_fps[logtype]; ! fprintf(f, "%s %s: %s\n", timebuf, typebuf, tbuf1); ! fflush(f); ! } ! ! return; ! } #ifdef I_STDARG *************** *** 225,280 **** (void) vsprintf(tbuf1, fmt, args); va_end(args); switch (logtype) { ! case LT_ERR: ! do_rawlog(logtype, "RPT: %s", tbuf1); ! break; case LT_CMD: ! if (options.log_commands) { ! strcpy(unp1, quick_unparse(player)); ! strcpy(unp2, quick_unparse(Location(player))); ! if (Suspect(player)) ! do_rawlog(logtype, "CMD: SUSPECT %s in %s: %s", unp1, unp2, tbuf1); ! else ! do_rawlog(logtype, "CMD: %s in %s: %s", unp1, unp2, tbuf1); ! } else { ! if (Suspect(player)) { ! strcpy(unp1, quick_unparse(player)); ! strcpy(unp2, quick_unparse(Location(player))); ! do_rawlog(logtype, "CMD: SUSPECT %s in %s: %s", unp1, unp2, tbuf1); ! } ! } break; case LT_WIZ: strcpy(unp1, quick_unparse(player)); if (GoodObject(object)) { strcpy(unp2, quick_unparse(object)); ! do_rawlog(logtype, "WIZ: %s --> %s: %s", unp1, unp2, tbuf1); } else { ! do_rawlog(logtype, "WIZ: %s: %s", unp1, tbuf1); } break; - case LT_CONN: - do_rawlog(logtype, "NET: %s", tbuf1); - break; - case LT_TRACE: - do_rawlog(logtype, "TRC: %s", tbuf1); - break; - case LT_CHECK: - do_rawlog(logtype, "%s", tbuf1); - break; - case LT_HUH: - if (!controls(player, Location(player))) { - strcpy(unp1, quick_unparse(player)); - strcpy(unp2, quick_unparse(Location(player))); - do_rawlog(logtype, "HUH: %s in %s [%s]: %s", - unp1, unp2, - (GoodObject(Location(player))) ? - Name(Owner(Location(player))) : "bad object", tbuf1); - } - break; - default: - do_rawlog(LT_ERR, "ERR: %s", tbuf1); } } --- 322,349 ---- (void) vsprintf(tbuf1, fmt, args); va_end(args); + if (!options.is_logged[logtype]) + return; + switch (logtype) { ! /* and...fall though... */ case LT_CMD: ! case LT_HUH: ! case LT_SUSPECT: ! strcpy(unp1, quick_unparse(player)); ! strcpy(unp2, quick_unparse(Location(player))); ! do_rawlog(logtype, "%s in %s: %s", unp1, unp2, tbuf1); break; + case LT_WIZ: strcpy(unp1, quick_unparse(player)); if (GoodObject(object)) { strcpy(unp2, quick_unparse(object)); ! do_rawlog(logtype, "%s --> %s: %s", unp1, unp2, tbuf1); } else { ! do_rawlog(logtype, "%s: %s", unp1, tbuf1); } break; } } *************** *** 296,359 **** return; } if (strcmp(str, LOG_WIPE_PASSWD)) { - const char *lname; - switch (logtype) { - case LT_CONN: - lname = "connection"; - break; - case LT_CHECK: - lname = "checkpoint"; - break; - case LT_CMD: - lname = "command"; - break; - case LT_TRACE: - lname = "trace"; - break; - case LT_WIZ: - lname = "wizard"; - break; - default: - lname = "unspecified"; - } do_log(LT_WIZ, player, NOTHING, ! "Invalid attempt to wipe the %s log, password %s", lname, str); return; } ! switch (logtype) { ! case LT_CONN: ! end_log(connlog_fp); ! unlink(CONNLOG); ! start_log(&connlog_fp, CONNLOG); ! do_log(LT_ERR, player, NOTHING, "Connect log wiped."); ! break; ! case LT_CHECK: ! end_log(checklog_fp); ! unlink(CHECKLOG); ! start_log(&checklog_fp, CHECKLOG); ! do_log(LT_ERR, player, NOTHING, "Checkpoint log wiped."); ! break; ! case LT_CMD: ! end_log(cmdlog_fp); ! unlink(CMDLOG); ! start_log(&cmdlog_fp, CMDLOG); ! do_log(LT_ERR, player, NOTHING, "Command log wiped."); ! break; ! case LT_TRACE: ! end_log(tracelog_fp); ! unlink(TRACELOG); ! start_log(&tracelog_fp, TRACELOG); ! do_log(LT_ERR, player, NOTHING, "Trace log wiped."); ! break; ! case LT_WIZ: ! end_log(wizlog_fp); ! unlink(WIZLOG); ! start_log(&wizlog_fp, WIZLOG); ! do_log(LT_ERR, player, NOTHING, "Wizard log wiped."); ! break; ! default: ! notify(player, "That is not a valid log."); return; } notify(player, "Log wiped."); } --- 365,394 ---- return; } if (strcmp(str, LOG_WIPE_PASSWD)) { do_log(LT_WIZ, player, NOTHING, ! "Invalid attempt to wipe the %s, password %s", LOGFILE(logtype), str); return; } ! if ((logtype == LT_ERR) || (logtype > 16)) { ! notify(player, "That log cannot be wiped."); return; } + + end_log(log_fps[logtype]); + unlink(LOGFILE(logtype)); + do_log(LT_ERR, player, NOTHING, "%s wiped.", LOGFILE(logtype)); + start_log(&log_fps[logtype], LOGFILE(logtype)); notify(player, "Log wiped."); } + + + /* Close and reopen the logfiles - called on SIGHUP */ + void + reopen_logs() + { + FILE *newerr; + /* close up the log files */ + end_all_logs(); + start_all_logs(); + } + *** /usr/local/mu/pennmush/src/look.c Mon Jul 17 10:59:53 2000 --- src/look.c Tue Jul 18 09:07:47 2000 *************** *** 803,820 **** /* print source */ switch (Source(thing)) { case NOTHING: ! fprintf(stderr, ! "*** BLEAH *** Weird exit %s(#%d) in #%d with source NOTHING.\n", Name(thing), thing, Destination(thing)); break; case AMBIGUOUS: ! fprintf(stderr, ! "*** BLEAH *** Weird exit %s(#%d) in #%d with source AMBIG.\n", Name(thing), thing, Destination(thing)); break; case HOME: ! fprintf(stderr, ! "*** BLEAH *** Weird exit %s(#%d) in #%d with source HOME.\n", Name(thing), thing, Destination(thing)); break; default: --- 803,820 ---- /* print source */ switch (Source(thing)) { case NOTHING: ! do_rawlog(LT_ERR, ! "*** BLEAH *** Weird exit %s(#%d) in #%d with source NOTHING.", Name(thing), thing, Destination(thing)); break; case AMBIGUOUS: ! do_rawlog(LT_ERR, ! "*** BLEAH *** Weird exit %s(#%d) in #%d with source AMBIG.", Name(thing), thing, Destination(thing)); break; case HOME: ! do_rawlog(LT_ERR, ! "*** BLEAH *** Weird exit %s(#%d) in #%d with source HOME.", Name(thing), thing, Destination(thing)); break; default: *** /usr/local/mu/pennmush/src/malias.c Mon Jul 17 10:59:53 2000 --- src/malias.c Tue Jul 18 09:07:47 2000 *************** *** 969,975 **** fgets(buffer, sizeof(buffer), fp); if (!strcmp(buffer, "\"*** End of MALIAS ***\"")) { ! fprintf(stderr, "MAIL: Error reading MALIAS list\n"); } } --- 969,975 ---- fgets(buffer, sizeof(buffer), fp); if (!strcmp(buffer, "\"*** End of MALIAS ***\"")) { ! do_rawlog(LT_ERR, "MAIL: Error reading MALIAS list"); } } *** /usr/local/mu/pennmush/src/move.c Mon Jul 17 10:59:54 2000 --- src/move.c Tue Jul 18 09:07:47 2000 *************** *** 180,196 **** loc = Home(player); if (!Mobile(player)) { ! do_rawlog(LT_ERR, "ERROR: Non object moved!! %d\n", player); deep--; return; } if (IsExit(loc)) { ! do_rawlog(LT_ERR, "ERROR: Attempt to move %d to exit %d\n", player, loc); deep--; return; } if (loc == player) { ! do_rawlog(LT_ERR, "ERROR: Attempt to move player %d into itself\n", player); deep--; return; } --- 180,196 ---- loc = Home(player); if (!Mobile(player)) { ! do_rawlog(LT_ERR, "Non object moved!! %d", player); deep--; return; } if (IsExit(loc)) { ! do_rawlog(LT_ERR, "Attempt to move %d to exit %d", player, loc); deep--; return; } if (loc == player) { ! do_rawlog(LT_ERR, "Attempt to move player %d into itself", player); deep--; return; } *************** *** 381,387 **** if (!GoodObject(var_dest)) { do_rawlog(LT_ERR, ! "Exit #%d destination became %d during move.\n", exit_m, var_dest); notify(player, "Exit destination is invalid."); return; --- 381,387 ---- if (!GoodObject(var_dest)) { do_rawlog(LT_ERR, ! "Exit #%d destination became %d during move.", exit_m, var_dest); notify(player, "Exit destination is invalid."); return; *** /usr/local/mu/pennmush/src/player.c Mon Jul 17 10:59:54 2000 --- src/player.c Tue Jul 18 09:07:47 2000 *************** *** 125,131 **** /* See if player is allowed to connect like this */ if (Guest(player) && (!Site_Can_Guest(host) || !Site_Can_Guest(ip))) { if (!Deny_Silent_Site(host, AMBIGUOUS) && !Deny_Silent_Site(ip, AMBIGUOUS)) { ! do_log(LT_CONN, 0, 0, "Connection to %s (GUEST) not allowed from %s (%s)", name, host, ip); } --- 125,131 ---- /* See if player is allowed to connect like this */ if (Guest(player) && (!Site_Can_Guest(host) || !Site_Can_Guest(ip))) { if (!Deny_Silent_Site(host, AMBIGUOUS) && !Deny_Silent_Site(ip, AMBIGUOUS)) { ! do_rawlog(LT_CONN, "Connection to %s (GUEST) not allowed from %s (%s)", name, host, ip); } *************** *** 134,140 **** && (!Site_Can_Connect(host, player) || !Site_Can_Connect(ip, player))) { if (!Deny_Silent_Site(host, player) && !Deny_Silent_Site(ip, player)) { ! do_log(LT_CONN, 0, 0, "Connection to %s (Non-GUEST) not allowed from %s (%s)", name, host, ip); } --- 134,140 ---- && (!Site_Can_Connect(host, player) || !Site_Can_Connect(ip, player))) { if (!Deny_Silent_Site(host, player) && !Deny_Silent_Site(ip, player)) { ! do_rawlog(LT_CONN, "Connection to %s (Non-GUEST) not allowed from %s (%s)", name, host, ip); } *************** *** 162,172 **** } if (i == db_top) { /* We failed to find an unconnected Guest */ ! do_log(LT_CONN, 0, 0, "Multiple connection to Guest #%d", player); } } if (Suspect_Site(host, player) || Suspect_Site(ip, player)) { ! do_log(LT_CONN, 0, 0, "Connection from Suspect site. Setting %s(#%d) suspect.", Name(player), player); Toggles(player) |= PLAYER_SUSPECT; --- 162,172 ---- } if (i == db_top) { /* We failed to find an unconnected Guest */ ! do_rawlog(LT_CONN, "Multiple connection to Guest #%d", player); } } if (Suspect_Site(host, player) || Suspect_Site(ip, player)) { ! do_rawlog(LT_CONN, "Connection from Suspect site. Setting %s(#%d) suspect.", Name(player), player); Toggles(player) |= PLAYER_SUSPECT; *************** *** 185,195 **** const char *ip; { if (!ok_player_name(name)) { ! do_log(LT_CONN, 0, 0, "Failed creation (bad name) from %s", host); return NOTHING; } if (!ok_password(password)) { ! do_log(LT_CONN, 0, 0, "Failed creation (bad password) from %s", host); return AMBIGUOUS; } /* else he doesn't already exist, create him */ --- 185,195 ---- const char *ip; { if (!ok_player_name(name)) { ! do_rawlog(LT_CONN, "Failed creation (bad name) from %s", host); return NOTHING; } if (!ok_password(password)) { ! do_rawlog(LT_CONN, "Failed creation (bad password) from %s", host); return AMBIGUOUS; } /* else he doesn't already exist, create him */ *************** *** 222,228 **** FILE *fp; if (!ok_player_name(name)) { ! do_log(LT_CONN, 0, 0, "Failed registration (bad name) from %s", host); return NOTHING; } /* Make sure that the email address is valid. A valid address must --- 222,228 ---- FILE *fp; if (!ok_player_name(name)) { ! do_rawlog(LT_CONN, "Failed registration (bad name) from %s", host); return NOTHING; } /* Make sure that the email address is valid. A valid address must *************** *** 238,244 **** p++; if (!Site_Can_Register(p)) { if (!Deny_Silent_Site(p, AMBIGUOUS)) { ! do_log(LT_CONN, 0, 0, "Failed registration (bad site in email: %s) from %s", email, host); } --- 238,244 ---- p++; if (!Site_Can_Register(p)) { if (!Deny_Silent_Site(p, AMBIGUOUS)) { ! do_rawlog(LT_CONN, "Failed registration (bad site in email: %s) from %s", email, host); } *************** *** 249,255 **** if (!Site_Can_Register(email)) { *p = '!'; if (!Deny_Silent_Site(email, AMBIGUOUS)) { ! do_log(LT_CONN, 0, 0, "Failed registration (bad site in email: %s) from %s", email, host); } --- 249,255 ---- if (!Site_Can_Register(email)) { *p = '!'; if (!Deny_Silent_Site(email, AMBIGUOUS)) { ! do_rawlog(LT_CONN, "Failed registration (bad site in email: %s) from %s", email, host); } *************** *** 258,264 **** *p = '!'; } else { if (!Deny_Silent_Site(host, AMBIGUOUS)) { ! do_log(LT_CONN, 0, 0, "Failed registration (bad email: %s) from %s", email, host); } return NOTHING; --- 258,264 ---- *p = '!'; } else { if (!Deny_Silent_Site(host, AMBIGUOUS)) { ! do_rawlog(LT_CONN, "Failed registration (bad email: %s) from %s", email, host); } return NOTHING; *************** *** 281,287 **** close(reserved); #endif if ((fp = popen(tprintf("%s -t", SENDMAIL), "w")) == NULL) { ! do_log(LT_CONN, 0, 0, "Failed registration of %s by %s: unable to open sendmail", name, email); #ifndef WIN32 --- 281,287 ---- close(reserved); #endif if ((fp = popen(tprintf("%s -t", SENDMAIL), "w")) == NULL) { ! do_rawlog(LT_CONN, "Failed registration of %s by %s: unable to open sendmail", name, email); #ifndef WIN32 *************** *** 318,324 **** const char *host; const char *ip; { ! do_log(LT_CONN, 0, 0, "Failed registration (no sendmail) from %s", host); return NOTHING; } #endif --- 318,324 ---- const char *host; const char *ip; { ! do_rawlog(LT_CONN, "Failed registration (no sendmail) from %s", host); return NOTHING; } #endif *** /usr/local/mu/pennmush/src/set.c Mon Jul 17 10:59:54 2000 --- src/set.c Tue Jul 18 09:07:47 2000 *************** *** 140,146 **** return; } /* everything ok, notify */ ! do_log(LT_CONN, 0, 0, "Name change by %s(#%d) to %s", Name(thing), thing, newname); if (Suspect(thing)) flag_broadcast(WIZARD, 0, --- 140,146 ---- return; } /* everything ok, notify */ ! do_rawlog(LT_CONN, "Name change by %s(#%d) to %s", Name(thing), thing, newname); if (Suspect(thing)) flag_broadcast(WIZARD, 0, *** /usr/local/mu/pennmush/src/speech.c Mon Jul 17 10:59:54 2000 --- src/speech.c Tue Jul 18 09:07:47 2000 *************** *** 1408,1414 **** /* prevent infinite loop if player is inside himself */ if (((room = Location(player)) == player) || !GoodObject(room)) { notify(player, "Invalid container object."); ! fprintf(stderr, "** BAD CONTAINER ** #%d is inside #%d.\n", player, room); return; } while (!IsRoom(room) && (rec < 15)) { --- 1408,1414 ---- /* prevent infinite loop if player is inside himself */ if (((room = Location(player)) == player) || !GoodObject(room)) { notify(player, "Invalid container object."); ! do_rawlog(LT_ERR, "** BAD CONTAINER ** #%d is inside #%d.", player, room); return; } while (!IsRoom(room) && (rec < 15)) { *** /usr/local/mu/pennmush/src/unparse.c Mon Jul 17 10:59:54 2000 --- src/unparse.c Tue Jul 18 09:07:47 2000 *************** *** 264,270 **** break; default: safe_str((char *) "Bad boolexp type!", boolexp_buf, &buftop); ! fprintf(stderr, "ERROR: unparse_boolexp1 bad boolexp type on #%d\n", player); break; } --- 264,270 ---- break; default: safe_str((char *) "Bad boolexp type!", boolexp_buf, &buftop); ! do_rawlog(LT_ERR, "ERROR: unparse_boolexp1 bad boolexp type on #%d", player); break; } *** /usr/local/mu/pennmush/src/utils.c Mon Jul 17 10:59:54 2000 --- src/utils.c Tue Jul 18 09:07:47 2000 *************** *** 60,66 **** #endif ptr = malloc(size); if (ptr == NULL) ! do_log(LT_ERR, 0, 0, "mush_malloc failed to malloc %d bytes for %s", size, check); return ptr; } --- 60,66 ---- #endif ptr = malloc(size); if (ptr == NULL) ! do_rawlog(LT_ERR, "mush_malloc failed to malloc %d bytes for %s", size, check); return ptr; } *** /usr/local/mu/pennmush/src/wiz.c Mon Jul 17 10:59:54 2000 --- src/wiz.c Tue Jul 18 09:07:47 2000 *************** *** 105,111 **** static int mem_usage _((dbref thing)); extern char confname[BUFFER_LEN]; - extern char errlog[BUFFER_LEN]; void do_pcreate(creator, player_name, player_password) --- 105,110 ---- *************** *** 981,990 **** options.daytime = state; } else if (!strcasecmp(param, "command_log")) { name = "LOG COMMANDS"; ! options.log_commands = state; } else if (!strcasecmp(param, "huh_log")) { name = "LOG HUHS"; ! options.log_huhs = state; } else if (!strcasecmp(param, "force_log")) { name = "LOG FORCES"; options.log_forces = state; --- 980,989 ---- options.daytime = state; } else if (!strcasecmp(param, "command_log")) { name = "LOG COMMANDS"; ! options.is_logged[1] = state; } else if (!strcasecmp(param, "huh_log")) { name = "LOG HUHS"; ! options.is_logged[7] = state; } else if (!strcasecmp(param, "force_log")) { name = "LOG FORCES"; options.log_forces = state; *************** *** 2312,2318 **** end_all_logs(); ! execl("netmush", "netmush", confname, errlog, NULL); #endif /* WIN32 */ #endif /* macintosh */ } --- 2311,2317 ---- end_all_logs(); ! execl("netmush", "netmush", confname, NULL); #endif /* WIN32 */ #endif /* macintosh */ } *** /usr/local/mu/pennmush/src/SWITCHES Mon Jul 17 10:59:54 2000 --- src/SWITCHES Tue Jul 18 09:07:47 2000 *************** *** 10,15 **** --- 10,16 ---- CLEAR CMD COMMANDS + CONFIG CONN CONNECT CONNECTED *************** *** 47,52 **** --- 48,54 ---- HEADER HERE HIDE + HUH ILIST INVENTORY IPRINT *************** *** 66,71 **** --- 68,74 ---- NOSIG NOSPACE NOTIFY + NOTICE NUKE OFF ON *************** *** 101,106 **** --- 104,110 ---- SPEAK STATS SUMMARY + SUSPECT TAG TELEPORT TF *************** *** 112,117 **** --- 116,124 ---- UNTAG URGENT USEFLAG + USER1 + USER2 + USER3 WHAT WIPE WIZ *** /usr/local/mu/pennmush/hdrs/switches.h Tue Jul 18 07:22:25 2000 --- hdrs/switches.h Tue Jul 18 09:07:47 2000 *************** *** 10,120 **** #define SWITCH_CLEAR 10 #define SWITCH_CMD 11 #define SWITCH_COMMANDS 12 ! #define SWITCH_CONN 13 ! #define SWITCH_CONNECT 14 ! #define SWITCH_CONNECTED 15 ! #define SWITCH_CONTENTS 16 ! #define SWITCH_COSTS 17 ! #define SWITCH_COUNT 18 ! #define SWITCH_CREATE 19 ! #define SWITCH_DATABASE 20 ! #define SWITCH_DB 21 ! #define SWITCH_DEBUG 22 ! #define SWITCH_DECOMPILE 23 ! #define SWITCH_DEFAULTS 24 ! #define SWITCH_DELETE 25 ! #define SWITCH_DESC 26 ! #define SWITCH_DESTROY 27 ! #define SWITCH_DISABLE 28 ! #define SWITCH_DOWN 29 ! #define SWITCH_DSTATS 30 ! #define SWITCH_EMIT 31 ! #define SWITCH_ENABLE 32 ! #define SWITCH_ERR 33 ! #define SWITCH_EXITS 34 ! #define SWITCH_FILE 35 ! #define SWITCH_FIRST 36 ! #define SWITCH_FLAGS 37 ! #define SWITCH_FOLDER 38 ! #define SWITCH_FOO 39 ! #define SWITCH_FORWARD 40 ! #define SWITCH_FSTATS 41 ! #define SWITCH_FULL 42 ! #define SWITCH_FUNCTIONS 43 ! #define SWITCH_FWD 44 ! #define SWITCH_GAG 45 ! #define SWITCH_GLOBALS 46 ! #define SWITCH_HEADER 47 ! #define SWITCH_HERE 48 ! #define SWITCH_HIDE 49 ! #define SWITCH_ILIST 50 ! #define SWITCH_INVENTORY 51 ! #define SWITCH_IPRINT 52 ! #define SWITCH_JOIN 53 ! #define SWITCH_LIST 54 ! #define SWITCH_LOWERCASE 55 ! #define SWITCH_ME 56 ! #define SWITCH_MEMBERS 57 ! #define SWITCH_MOD 58 ! #define SWITCH_MORTAL 59 ! #define SWITCH_MOTD 60 ! #define SWITCH_MUTE 61 ! #define SWITCH_NAME 62 ! #define SWITCH_NO 63 ! #define SWITCH_NOEVAL 64 ! #define SWITCH_NOISY 65 ! #define SWITCH_NOSIG 66 ! #define SWITCH_NOSPACE 67 ! #define SWITCH_NOTIFY 68 ! #define SWITCH_NUKE 69 ! #define SWITCH_OFF 70 ! #define SWITCH_ON 71 ! #define SWITCH_OUTSIDE 72 ! #define SWITCH_OVERRIDE 73 ! #define SWITCH_PANIC 74 ! #define SWITCH_PARANOID 75 ! #define SWITCH_PLAYERS 76 ! #define SWITCH_PORT 77 ! #define SWITCH_POSE 78 ! #define SWITCH_PRESERVE 79 ! #define SWITCH_PRINT 80 ! #define SWITCH_PRIVS 81 ! #define SWITCH_PURGE 82 ! #define SWITCH_QUICK 83 ! #define SWITCH_QUIET 84 ! #define SWITCH_READ 85 ! #define SWITCH_REBOOT 86 ! #define SWITCH_REGISTER 87 ! #define SWITCH_REMOVE 88 ! #define SWITCH_RENAME 89 ! #define SWITCH_RETROACTIVE 90 ! #define SWITCH_ROOM 91 ! #define SWITCH_ROOMS 92 ! #define SWITCH_ROYALTY 93 ! #define SWITCH_SEE 94 ! #define SWITCH_SEEFLAG 95 ! #define SWITCH_SELF 96 ! #define SWITCH_SEND 97 ! #define SWITCH_SET 98 ! #define SWITCH_SILENT 99 ! #define SWITCH_SKIPDEFAULTS 100 ! #define SWITCH_SPEAK 101 ! #define SWITCH_STATS 102 ! #define SWITCH_SUMMARY 103 ! #define SWITCH_TAG 104 ! #define SWITCH_TELEPORT 105 ! #define SWITCH_TF 106 ! #define SWITCH_THINGS 107 ! #define SWITCH_TITLE 108 ! #define SWITCH_TRACE 109 ! #define SWITCH_UNCLEAR 110 ! #define SWITCH_UNFOLDER 111 ! #define SWITCH_UNTAG 112 ! #define SWITCH_URGENT 113 ! #define SWITCH_USEFLAG 114 ! #define SWITCH_WHAT 115 ! #define SWITCH_WIPE 116 ! #define SWITCH_WIZ 117 ! #define SWITCH_WIZARD 118 ! #define SWITCH_YES 119 ! #define SWITCH_ZONE 120 --- 10,127 ---- #define SWITCH_CLEAR 10 #define SWITCH_CMD 11 #define SWITCH_COMMANDS 12 ! #define SWITCH_CONFIG 13 ! #define SWITCH_CONN 14 ! #define SWITCH_CONNECT 15 ! #define SWITCH_CONNECTED 16 ! #define SWITCH_CONTENTS 17 ! #define SWITCH_COSTS 18 ! #define SWITCH_COUNT 19 ! #define SWITCH_CREATE 20 ! #define SWITCH_DATABASE 21 ! #define SWITCH_DB 22 ! #define SWITCH_DEBUG 23 ! #define SWITCH_DECOMPILE 24 ! #define SWITCH_DEFAULTS 25 ! #define SWITCH_DELETE 26 ! #define SWITCH_DESC 27 ! #define SWITCH_DESTROY 28 ! #define SWITCH_DISABLE 29 ! #define SWITCH_DOWN 30 ! #define SWITCH_DSTATS 31 ! #define SWITCH_EMIT 32 ! #define SWITCH_ENABLE 33 ! #define SWITCH_ERR 34 ! #define SWITCH_EXITS 35 ! #define SWITCH_FILE 36 ! #define SWITCH_FIRST 37 ! #define SWITCH_FLAGS 38 ! #define SWITCH_FOLDER 39 ! #define SWITCH_FOO 40 ! #define SWITCH_FORWARD 41 ! #define SWITCH_FSTATS 42 ! #define SWITCH_FULL 43 ! #define SWITCH_FUNCTIONS 44 ! #define SWITCH_FWD 45 ! #define SWITCH_GAG 46 ! #define SWITCH_GLOBALS 47 ! #define SWITCH_HEADER 48 ! #define SWITCH_HERE 49 ! #define SWITCH_HIDE 50 ! #define SWITCH_HUH 51 ! #define SWITCH_ILIST 52 ! #define SWITCH_INVENTORY 53 ! #define SWITCH_IPRINT 54 ! #define SWITCH_JOIN 55 ! #define SWITCH_LIST 56 ! #define SWITCH_LOWERCASE 57 ! #define SWITCH_ME 58 ! #define SWITCH_MEMBERS 59 ! #define SWITCH_MOD 60 ! #define SWITCH_MORTAL 61 ! #define SWITCH_MOTD 62 ! #define SWITCH_MUTE 63 ! #define SWITCH_NAME 64 ! #define SWITCH_NO 65 ! #define SWITCH_NOEVAL 66 ! #define SWITCH_NOISY 67 ! #define SWITCH_NOSIG 68 ! #define SWITCH_NOSPACE 69 ! #define SWITCH_NOTICE 70 ! #define SWITCH_NOTIFY 71 ! #define SWITCH_NUKE 72 ! #define SWITCH_OFF 73 ! #define SWITCH_ON 74 ! #define SWITCH_OUTSIDE 75 ! #define SWITCH_OVERRIDE 76 ! #define SWITCH_PANIC 77 ! #define SWITCH_PARANOID 78 ! #define SWITCH_PLAYERS 79 ! #define SWITCH_PORT 80 ! #define SWITCH_POSE 81 ! #define SWITCH_PRESERVE 82 ! #define SWITCH_PRINT 83 ! #define SWITCH_PRIVS 84 ! #define SWITCH_PURGE 85 ! #define SWITCH_QUICK 86 ! #define SWITCH_QUIET 87 ! #define SWITCH_READ 88 ! #define SWITCH_REBOOT 89 ! #define SWITCH_REGISTER 90 ! #define SWITCH_REMOVE 91 ! #define SWITCH_RENAME 92 ! #define SWITCH_RETROACTIVE 93 ! #define SWITCH_ROOM 94 ! #define SWITCH_ROOMS 95 ! #define SWITCH_ROYALTY 96 ! #define SWITCH_SEE 97 ! #define SWITCH_SEEFLAG 98 ! #define SWITCH_SELF 99 ! #define SWITCH_SEND 100 ! #define SWITCH_SET 101 ! #define SWITCH_SILENT 102 ! #define SWITCH_SKIPDEFAULTS 103 ! #define SWITCH_SPEAK 104 ! #define SWITCH_STATS 105 ! #define SWITCH_SUMMARY 106 ! #define SWITCH_SUSPECT 107 ! #define SWITCH_TAG 108 ! #define SWITCH_TELEPORT 109 ! #define SWITCH_TF 110 ! #define SWITCH_THINGS 111 ! #define SWITCH_TITLE 112 ! #define SWITCH_TRACE 113 ! #define SWITCH_UNCLEAR 114 ! #define SWITCH_UNFOLDER 115 ! #define SWITCH_UNTAG 116 ! #define SWITCH_URGENT 117 ! #define SWITCH_USEFLAG 118 ! #define SWITCH_USER1 119 ! #define SWITCH_USER2 120 ! #define SWITCH_USER3 121 ! #define SWITCH_WHAT 122 ! #define SWITCH_WIPE 123 ! #define SWITCH_WIZ 124 ! #define SWITCH_WIZARD 125 ! #define SWITCH_YES 126 ! #define SWITCH_ZONE 127 *** /usr/local/mu/pennmush/hdrs/conf.h Mon Jul 17 10:59:52 2000 --- hdrs/conf.h Tue Jul 18 09:07:47 2000 *************** *** 156,163 **** FBLOCK *down_fcache[2]; FBLOCK *full_fcache[2]; FBLOCK *guest_fcache[2]; ! int log_commands; ! int log_huhs; int log_forces; int log_walls; int support_pueblo; --- 156,168 ---- FBLOCK *down_fcache[2]; FBLOCK *full_fcache[2]; FBLOCK *guest_fcache[2]; ! char logfiles[16][256]; ! int use_syslog; ! char syslog_name[32]; ! int use_chanlog; ! char log_channel[16][31]; ! int log_level[16]; ! int is_logged[16]; int log_forces; int log_walls; int support_pueblo; *************** *** 325,330 **** --- 330,338 ---- #define DEF_DB_OUT (options.output_db) #define BASE_ROOM (options.base_room) + + #define LOGFILE(x) (options.logfiles[x]) + #define USE_SYSLOG (options.use_syslog) #define PURGE_INTERVAL (options.purge_interval) #define DBCK_INTERVAL (options.dbck_interval) *** /usr/local/mu/pennmush/hdrs/dbdefs.h Mon Jul 17 10:59:52 2000 --- hdrs/dbdefs.h Tue Jul 18 09:07:47 2000 *************** *** 373,386 **** #endif /* USE_MAILER */ /* log types */ ! #define LT_ERR 0 ! #define LT_CMD 1 ! #define LT_WIZ 2 ! #define LT_CONN 3 ! #define LT_TRACE 4 ! #define LT_RPAGE 5 /* Obsolete */ ! #define LT_CHECK 6 ! #define LT_HUH 7 /* tokens for locks */ #defin