Logger messages (#818)
* Change the way logger messages are generated by using the printf-like method * Use single quotes around log values that can be empty strings * Fix bug in log message
This commit is contained in:
committed by
GitHub
parent
671888b6ea
commit
1b89d0a4f0
@@ -71,7 +71,7 @@ class NWSpellCheck():
|
||||
outFile.write("%s\n" % newWord)
|
||||
self.projDict.append(newWord)
|
||||
except Exception:
|
||||
logger.error("Failed to add word to project word list %s" % str(self.projectDict))
|
||||
logger.error("Failed to add word to project word list %s", str(self.projectDict))
|
||||
nw.logException()
|
||||
return False
|
||||
return True
|
||||
@@ -111,7 +111,7 @@ class NWSpellCheck():
|
||||
theLine = theLine.strip()
|
||||
if len(theLine) > 0 and theLine not in self.projDict:
|
||||
self.projDict.append(theLine)
|
||||
logger.debug("Project word list contains %d words" % len(self.projDict))
|
||||
logger.debug("Project word list contains %d words", len(self.projDict))
|
||||
|
||||
except Exception:
|
||||
logger.error("Failed to load project word list")
|
||||
@@ -149,10 +149,10 @@ class NWSpellEnchant(NWSpellCheck):
|
||||
self.theBroker = enchant.Broker()
|
||||
self.theDict = self.theBroker.request_dict(theLang)
|
||||
self.spellLanguage = theLang
|
||||
logger.debug("Enchant spell checking for language %s loaded" % theLang)
|
||||
logger.debug("Enchant spell checking for language '%s' loaded", theLang)
|
||||
|
||||
except Exception:
|
||||
logger.error("Failed to load enchant spell checking for language %s" % theLang)
|
||||
logger.error("Failed to load enchant spell checking for language '%s'", theLang)
|
||||
self.theDict = FakeEnchant()
|
||||
self.spellLanguage = None
|
||||
|
||||
@@ -259,12 +259,12 @@ class NWSpellSimple(NWSpellCheck):
|
||||
continue
|
||||
self.theWords.add(theLine.strip().lower())
|
||||
|
||||
logger.debug("Spell check dictionary for language %s loaded" % theLang)
|
||||
logger.debug("Dictionary contains %d words" % len(self.theWords))
|
||||
logger.debug("Spell check dictionary for language '%s' loaded", theLang)
|
||||
logger.debug("Dictionary contains %d words", len(self.theWords))
|
||||
self.spellLanguage = theLang
|
||||
|
||||
except Exception:
|
||||
logger.error("Failed to load spell check word list for language %s" % theLang)
|
||||
logger.error("Failed to load spell check word list for language '%s'", theLang)
|
||||
nw.logException()
|
||||
self.spellLanguage = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user