From cabd9d7cfd2bd4b526330566a956e31d5335a1f7 Mon Sep 17 00:00:00 2001 From: jcao219 Date: Tue, 2 Aug 2011 20:54:14 -0500 Subject: [PATCH] improved the logger (added a bare log without extra talk) --- var.py | 1 + wolfgame.py | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/var.py b/var.py index 49128e4..2e5007b 100644 --- a/var.py +++ b/var.py @@ -11,6 +11,7 @@ START_WITH_DAY = False KILL_IDLE_TIME = 300 WARN_IDLE_TIME = 180 LOG_FILENAME = "gamelog.txt" +BARE_LOG_FILENAME = "barelog.txt" # HIT MISS SUICIDE GUN_CHANCES = ( 5/7 , 1/7 , 1/7 ) diff --git a/wolfgame.py b/wolfgame.py index a2e9152..b6d1ff3 100644 --- a/wolfgame.py +++ b/wolfgame.py @@ -92,7 +92,7 @@ def connect_callback(cli): var.GRAVEYARD_LOCK = threading.RLock() var.GAME_ID = 0 - var.LOGGER = WolfgameLogger(var.LOG_FILENAME) + var.LOGGER = WolfgameLogger(var.LOG_FILENAME, var.BARE_LOG_FILENAME) if botconfig.DEBUG_MODE: var.NIGHT_TIME_LIMIT = 0 # 90 @@ -418,7 +418,7 @@ def stats(cli, nick, chan, rest): message[-1], vb) cli.msg(chan, stats_mssg) - var.LOGGER.logMessage(stats_mssg) + var.LOGGER.logMessage(stats_mssg.replace("\02", "")) @@ -664,9 +664,9 @@ def chk_win(cli): cli.msg(chan, ('\u0002The villagers, during their celebrations, are '+ 'frightened as they hear a loud howl. The wolves are '+ 'not gone!\u0002')) - var.LOGGER.logMessage(('\u0002The villagers, during their celebrations, are '+ + var.LOGGER.logMessage(('The villagers, during their celebrations, are '+ 'frightened as they hear a loud howl. The wolves are '+ - 'not gone!\u0002')) + 'not gone!')) return False else: return False @@ -790,7 +790,7 @@ def update_last_said(cli, nick, chan, rest): var.LAST_SAID_TIME[nick] = datetime.now() if var.PHASE not in ("none", "join"): - var.LOGGER.log("<{0}> {1}".format(nick, rest)) + var.LOGGER.logChannelMessage(nick, rest)