From f5c3fc432454d2e456ba7f0911c02eeb6853f6a5 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Sun, 26 Aug 2012 06:40:38 -0400 Subject: [PATCH] DEbug the debug code :-) --- irker.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/irker.py b/irker.py index bf4e064..28fe59a 100755 --- a/irker.py +++ b/irker.py @@ -67,8 +67,8 @@ class Session(): class Irker: "Persistent IRC multiplexer." def __init__(self, debuglevel=0): - self.debuglevel = 0 - self.irc = irclib.IRC() + self.debuglevel = debuglevel + self.irc = irclib.IRC(self.debuglevel-1) thread = threading.Thread(target=self.irc.process_forever) self.irc._thread = thread thread.daemon = True @@ -79,8 +79,8 @@ class Irker: sys.stderr.write("irker: " + errmsg + "\n") def debug(self, level, errmsg): "Debugging information." - if level >= self.debuglevel: - sys.stderr.write("irker: " + errmsg + "\n") + if self.debuglevel >= level: + sys.stderr.write("irker[%d]: %s\n" % (self.debuglevel, errmsg)) def run(self, ifp, await=True): "Accept JSON relay requests from specified stream." while True: -- 2.26.2