more error logging tweaks

This commit is contained in:
deathbybandaid 2019-05-13 12:07:27 -04:00
parent 8fe7254b20
commit b511462b15
2 changed files with 5 additions and 9 deletions

View File

@ -18,12 +18,8 @@ def bot_startup_monologue_start(bot, trigger):
searchphrasefound = []
for line in debuglines:
if "modules failed to load" in str(line) and "0 modules failed to load" not in str(line):
searchphrase = str(line).replace(" modules failed to load", "")
searchphrasefound.append(str(searchphrase) + " module(s) failed")
elif "dict files failed to load" in str(line) and "0 dict files failed to load" not in str(line):
searchphrase = str(line).replace(" dict files failed to load", "")
searchphrasefound.append(str(searchphrase) + " dict file(s) failed")
if str(line).endswith("failed to load") and not str(line).startswith("0"):
searchphrasefound.append(line)
if len(searchphrasefound):
for foundphase in searchphrasefound:

View File

@ -440,10 +440,10 @@ def read_directory_json_to_dict(bot, directories, configtypename="Config File",
if filecount:
if bot:
bot_logging(bot, log_from, 'Registered %d %s files,' % (filecount, configtypename))
bot_logging(bot, log_from, '%d %s files failed to load' % (fileopenfail, configtypename))
bot_logging(bot, log_from, 'Registered %d %s dict files,' % (filecount, configtypename))
bot_logging(bot, log_from, '%d %s dict files failed to load' % (fileopenfail, configtypename), True)
else:
if bot:
bot_logging(bot, log_from, "Warning: Couldn't load any %s files" % (configtypename))
bot_logging(bot, log_from, "Warning: Couldn't load any %s dict files" % (configtypename))
return configs_dict