From cd2e54e7d8219633c3a801daf2730449f33ec59f Mon Sep 17 00:00:00 2001 From: Firepup Sixfifty Date: Sun, 5 Nov 2023 20:24:43 -0600 Subject: [PATCH] Fewer log methods is better --- bot.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/bot.py b/bot.py index 3c880cd..dc79c0f 100644 --- a/bot.py +++ b/bot.py @@ -47,7 +47,7 @@ class bot: self.np = re.compile(npbase.replace("MAX", f"{nicklen}")) self.log(f"NICKLEN set to {nicklen}") elif ircmsg.find("Nickname") != -1: - self.warn("Nickname in use") + self.log("Nickname in use", "WARN") self.botnick = f"{botnick}{r.randint(0,1000)}" self.send(f"NICK {botnick}\n") self.log(f"botnick is now {botnick}") @@ -73,12 +73,9 @@ class bot: return bytes(self.queue.pop(0)) return data - def log(self, message: object) -> None: + def log(self, message: object, level: str = "LOG") -> None: log(message, self.server) - def warn(self, message: object) -> None: - log(message, self.server, "WARN") - def exit(message: object) -> NoReturn: log(message, self.server, "EXIT") exit(1)