use % formatting in logging-functions
This commit is contained in:
parent
c25db473ec
commit
e7fc91229e
|
@ -67,7 +67,7 @@ class Client:
|
||||||
'''
|
'''
|
||||||
client connects at "timestamp"
|
client connects at "timestamp"
|
||||||
'''
|
'''
|
||||||
logger.debug('CONNECT {}'.format(str(self)))
|
logger.debug('CONNECT %s', self)
|
||||||
self.connected += 1
|
self.connected += 1
|
||||||
self._last_connect = timestamp
|
self._last_connect = timestamp
|
||||||
|
|
||||||
|
@ -75,7 +75,7 @@ class Client:
|
||||||
'''
|
'''
|
||||||
client disconnects at "timestamp"
|
client disconnects at "timestamp"
|
||||||
'''
|
'''
|
||||||
logger.debug('DISCONNECT {}'.format(str(self)))
|
logger.debug('DISCONNECT %s', self)
|
||||||
if not self.connected:
|
if not self.connected:
|
||||||
logger.debug('^ disconnect before connect')
|
logger.debug('^ disconnect before connect')
|
||||||
raise InvalidLog('disconnect before connect!')
|
raise InvalidLog('disconnect before connect!')
|
||||||
|
@ -88,7 +88,7 @@ class Client:
|
||||||
'''
|
'''
|
||||||
client kicks "target" (Client-obj)
|
client kicks "target" (Client-obj)
|
||||||
'''
|
'''
|
||||||
logger.debug('KICK {} -> {}'.format(str(self), str(target)))
|
logger.debug('KICK %s -> %s', self, target)
|
||||||
target.pkicks += 1
|
target.pkicks += 1
|
||||||
self.kicks += 1
|
self.kicks += 1
|
||||||
|
|
||||||
|
@ -96,7 +96,7 @@ class Client:
|
||||||
'''
|
'''
|
||||||
client bans "target" (Client-obj)
|
client bans "target" (Client-obj)
|
||||||
'''
|
'''
|
||||||
logger.debug('BAN {} -> {}'.format(str(self), str(target)))
|
logger.debug('BAN %s -> %s', self, target)
|
||||||
target.pbans += 1
|
target.pbans += 1
|
||||||
self.bans += 1
|
self.bans += 1
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ def parse_logs(log_path, ident_map={}):
|
||||||
for file_path in file_paths:
|
for file_path in file_paths:
|
||||||
log_file = open(file_path)
|
log_file = open(file_path)
|
||||||
# process lines
|
# process lines
|
||||||
logger.debug('Started parsing of {}'.format(log_file.name))
|
logger.debug('Started parsing of %s', log_file.name)
|
||||||
for line in log_file:
|
for line in log_file:
|
||||||
parts = line.split('|')
|
parts = line.split('|')
|
||||||
log_format = '%Y-%m-%d %H:%M:%S.%f'
|
log_format = '%Y-%m-%d %H:%M:%S.%f'
|
||||||
|
@ -51,5 +51,5 @@ def parse_logs(log_path, ident_map={}):
|
||||||
invoker.ban(client)
|
invoker.ban(client)
|
||||||
else:
|
else:
|
||||||
invoker.kick(client)
|
invoker.kick(client)
|
||||||
logger.debug('Finished parsing of {}'.format(log_file.name))
|
logger.debug('Finished parsing of %s', log_file.name)
|
||||||
return clients
|
return clients
|
||||||
|
|
Loading…
Reference in New Issue