Some completeness in logger output
This commit is contained in:
+3
-1
@@ -216,7 +216,9 @@ def main(sysArgs=None):
|
||||
logger.addHandler(cHandle)
|
||||
|
||||
logger.setLevel(debugLevel)
|
||||
logger.info("This is %s %s" % (__package__, __version__))
|
||||
logger.info("Starting %s" % __package__)
|
||||
logger.info("Version: %s (%s)" % (__version__, __hexversion__))
|
||||
logger.info("Last Release: %s" % __date__)
|
||||
|
||||
# Check Packages and Versions
|
||||
errorData = []
|
||||
|
||||
@@ -222,6 +222,7 @@ class Config:
|
||||
"""Initialise the config class. The manual setting of confPath
|
||||
and dataPath is mainly intended for the test suite.
|
||||
"""
|
||||
logger.debug("Initialising Config ...")
|
||||
if confPath is None:
|
||||
confRoot = QStandardPaths.writableLocation(QStandardPaths.ConfigLocation)
|
||||
self.confPath = path.join(path.abspath(confRoot), self.appHandle)
|
||||
@@ -304,6 +305,8 @@ class Config:
|
||||
if self.spellLanguage is None:
|
||||
self.spellLanguage = "en"
|
||||
|
||||
logger.debug("Config initialisation complete")
|
||||
|
||||
return True
|
||||
|
||||
def loadConfig(self):
|
||||
|
||||
@@ -1041,6 +1041,7 @@ class NWProject():
|
||||
return
|
||||
|
||||
# Then check the files in the data folder
|
||||
logger.debug("Checking files in project content folder")
|
||||
orphanFiles = []
|
||||
for fileItem in listdir(self.projContent):
|
||||
if not fileItem.endswith(".nwd"):
|
||||
|
||||
@@ -115,12 +115,12 @@ class NWSpellCheck():
|
||||
if not path.isfile(projectDict):
|
||||
return
|
||||
try:
|
||||
with open(projectDict,mode="r",encoding="utf-8") as wordsFile:
|
||||
logger.debug("Loading project word list")
|
||||
with open(projectDict, mode="r", encoding="utf-8") as wordsFile:
|
||||
for theLine in wordsFile:
|
||||
theLine = theLine.strip()
|
||||
if len(theLine) > 0 and theLine not in self.PROJW:
|
||||
self.PROJW.append(theLine)
|
||||
logger.debug("Project word list")
|
||||
logger.debug("Project word list contains %d words" % len(self.PROJW))
|
||||
except Exception as e:
|
||||
logger.error("Failed to load project word list")
|
||||
|
||||
+2
-2
@@ -477,7 +477,7 @@ class GuiDocViewDetails(QScrollArea):
|
||||
def __init__(self, theParent):
|
||||
QScrollArea.__init__(self, theParent)
|
||||
|
||||
logger.debug("Initialising DocViewDetails ...")
|
||||
logger.debug("Initialising GuiDocViewDetails ...")
|
||||
self.mainConf = nw.CONFIG
|
||||
self.theParent = theParent
|
||||
self.theProject = theParent.theProject
|
||||
@@ -508,7 +508,7 @@ class GuiDocViewDetails(QScrollArea):
|
||||
self.setWidgetResizable(True)
|
||||
self.setMinimumHeight(self.mainConf.pxInt(50))
|
||||
|
||||
logger.debug("DocViewDetails initialisation complete")
|
||||
logger.debug("GuiDocViewDetails initialisation complete")
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
||||
def __init__(self, theDoc, theParent):
|
||||
QSyntaxHighlighter.__init__(self, theDoc)
|
||||
|
||||
logger.debug("Initialising DocHighlighter ...")
|
||||
logger.debug("Initialising GuiDocHighlighter ...")
|
||||
self.mainConf = nw.CONFIG
|
||||
self.theDoc = theDoc
|
||||
self.theParent = theParent
|
||||
@@ -70,7 +70,7 @@ class GuiDocHighlighter(QSyntaxHighlighter):
|
||||
|
||||
self.initHighlighter()
|
||||
|
||||
logger.debug("DocHighlighter initialisation complete")
|
||||
logger.debug("GuiDocHighlighter initialisation complete")
|
||||
|
||||
return
|
||||
|
||||
|
||||
@@ -525,9 +525,13 @@ class GuiProjectTree(QTreeWidget):
|
||||
always make sure items with a parent have had their parent item
|
||||
sent first.
|
||||
"""
|
||||
logger.debug("Building project tree ...")
|
||||
self.clear()
|
||||
iCount = 0
|
||||
for nwItem in self.theProject.getProjectItems():
|
||||
iCount += 1
|
||||
self._addTreeItem(nwItem)
|
||||
logger.debug("%d items added to project tree" % iCount)
|
||||
return True
|
||||
|
||||
def getSelectedHandle(self):
|
||||
|
||||
+2
-2
@@ -44,7 +44,7 @@ class GuiMainStatus(QStatusBar):
|
||||
def __init__(self, theParent):
|
||||
QStatusBar.__init__(self, theParent)
|
||||
|
||||
logger.debug("Initialising MainStatus ...")
|
||||
logger.debug("Initialising GuiMainStatus ...")
|
||||
|
||||
self.mainConf = nw.CONFIG
|
||||
self.theParent = theParent
|
||||
@@ -123,7 +123,7 @@ class GuiMainStatus(QStatusBar):
|
||||
self.sessionTimer.timeout.connect(self._updateTime)
|
||||
self.sessionTimer.start()
|
||||
|
||||
logger.debug("MainStatus initialisation complete")
|
||||
logger.debug("GuiMainStatus initialisation complete")
|
||||
|
||||
self.clearStatus()
|
||||
|
||||
|
||||
+2
-2
@@ -750,11 +750,11 @@ class GuiIcons:
|
||||
self.mainConf.iconPath, self.fbackName, "%s-dark.svg" % iconKey
|
||||
)
|
||||
if path.isfile(fbackIcon):
|
||||
logger.verbose("Loading icon '%s' from fallback theme" % iconKey)
|
||||
logger.verbose("Loading icon '%s' from fallback theme (dark mode)" % iconKey)
|
||||
return QIcon(fbackIcon)
|
||||
fbackIcon = path.join(self.mainConf.iconPath, self.fbackName, "%s.svg" % iconKey)
|
||||
if path.isfile(fbackIcon):
|
||||
logger.verbose("Loading icon '%s' from fallback theme" % iconKey)
|
||||
logger.verbose("Loading icon '%s' from fallback theme (light mode)" % iconKey)
|
||||
return QIcon(fbackIcon)
|
||||
|
||||
# Give up and return an empty icon
|
||||
|
||||
+4
-1
@@ -55,7 +55,6 @@ class GuiMain(QMainWindow):
|
||||
def __init__(self):
|
||||
QMainWindow.__init__(self)
|
||||
|
||||
logger.info("Starting %s" % nw.__package__)
|
||||
logger.debug("Initialising GUI ...")
|
||||
self.mainConf = nw.CONFIG
|
||||
|
||||
@@ -232,6 +231,8 @@ class GuiMain(QMainWindow):
|
||||
else:
|
||||
self.manageProjects()
|
||||
|
||||
logger.debug("%s is ready ..." % nw.__package__)
|
||||
|
||||
return
|
||||
|
||||
def clearGUI(self):
|
||||
@@ -435,6 +436,8 @@ class GuiMain(QMainWindow):
|
||||
if self.theIndex.indexBroken:
|
||||
self.rebuildIndex()
|
||||
|
||||
logger.debug("Project load complete")
|
||||
|
||||
return True
|
||||
|
||||
def saveProject(self, autoSave=False):
|
||||
|
||||
Reference in New Issue
Block a user