Removed useless variable + log error even without debug var enabled

This commit is contained in:
wr34k 2018-07-03 11:21:49 +02:00
parent 1bcccfc1d7
commit 3a5fa320b8
2 changed files with 4 additions and 9 deletions

View File

@ -24,7 +24,6 @@ username = 'McBuffer'
realname = '** WE FIGHTIN **'
optkey= "!"
timeout=0.4
DEBUG = True
@ -74,12 +73,10 @@ class IrcBot(object):
self.listen()
def register(self):
self.log.info("Identifying...")
self.raw("USER {} 0 * :{}".format(self.user, self.real))
self.raw("NICK {}".format(self.nick))
def updateNick(self):
self.log.info("Updating NICK to {}".format(self.nick))
self.raw("NICK {}".format(self.nick))
def listen(self):
@ -115,7 +112,6 @@ class IrcBot(object):
pass
def join(self):
self.log.info("Now joining {} ...".format(self.channel))
self.raw("JOIN {} {}".format(self.channel, self.chankey)) if self.chankey else self.raw("JOIN {}".format(self.channel))

9
log.py
View File

@ -72,8 +72,7 @@ class Log(object):
self.func( self.construct( "[", self.colors.fg.LIGHTYELLOW, "!", self.colors.fg.DEFAULT, "] ", msg ) )
def error(self, msg, exception=None):
if self.debug:
self.func( self.construct( "[", self.colors.fg.LIGHTRED, "x", self.colors.fg.DEFAULT, "] ", msg ) )
if exception:
self.func( self.construct( "[", self.colors.fg.LIGHTRED, "x", self.colors.fg.DEFAULT, "] ", str(exception) ) )
traceback.print_tb(exception.__traceback__)
self.func( self.construct( "[", self.colors.fg.LIGHTRED, "x", self.colors.fg.DEFAULT, "] ", msg ) )
if exception:
self.func( self.construct( "[", self.colors.fg.LIGHTRED, "x", self.colors.fg.DEFAULT, "] ", str(exception) ) )
traceback.print_tb(exception.__traceback__)