mirror of
https://github.com/SpiceBot/SpiceBot.git
synced 2026-11-13 06:59:53 -05:00
add ignore lines
This commit is contained in:
parent
e806fff02b
commit
59da3b7395
@ -68,6 +68,10 @@ def join_log_channel(bot, trigger):
|
|||||||
|
|
||||||
def stdio_logs_fetch(bot):
|
def stdio_logs_fetch(bot):
|
||||||
|
|
||||||
|
stdio_ignore = ["Loaded:"]
|
||||||
|
for logtype in bot.memory['SpiceBot_Logs']["logs"].keys():
|
||||||
|
stdio_ignore.append("[" + logtype + "]")
|
||||||
|
|
||||||
logfile = os.path.os.path.join(bot.config.core.logdir, 'stdio.log')
|
logfile = os.path.os.path.join(bot.config.core.logdir, 'stdio.log')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -84,10 +88,16 @@ def stdio_logs_fetch(bot):
|
|||||||
linenumindex.append(currentline)
|
linenumindex.append(currentline)
|
||||||
currentline += 1
|
currentline += 1
|
||||||
last_start = max(linenumindex)
|
last_start = max(linenumindex)
|
||||||
debuglines = log_file_lines[last_start:]
|
filelines = log_file_lines[last_start:]
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
debuglines = e
|
debuglines = e
|
||||||
|
filelines = []
|
||||||
|
|
||||||
debuglines = []
|
debuglines = []
|
||||||
|
for line in filelines:
|
||||||
|
if not line.startswith(tuple(stdio_ignore)):
|
||||||
|
if not line.isspace():
|
||||||
|
debuglines.append(str(line))
|
||||||
|
|
||||||
return debuglines
|
return debuglines
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user