diff --git a/nw/__init__.py b/nw/__init__.py index 0d1c2088..98436cca 100644 --- a/nw/__init__.py +++ b/nw/__init__.py @@ -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 = [] diff --git a/nw/config.py b/nw/config.py index 5c734981..a1e222dd 100644 --- a/nw/config.py +++ b/nw/config.py @@ -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): diff --git a/nw/core/project.py b/nw/core/project.py index caa81b09..0784fc7a 100644 --- a/nw/core/project.py +++ b/nw/core/project.py @@ -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"): diff --git a/nw/core/spellcheck.py b/nw/core/spellcheck.py index 6296bc60..44d0fc38 100644 --- a/nw/core/spellcheck.py +++ b/nw/core/spellcheck.py @@ -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") diff --git a/nw/gui/docbars.py b/nw/gui/docbars.py index 839ae024..f7406c17 100644 --- a/nw/gui/docbars.py +++ b/nw/gui/docbars.py @@ -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 diff --git a/nw/gui/dochighlight.py b/nw/gui/dochighlight.py index cda6ac03..afd5a77c 100644 --- a/nw/gui/dochighlight.py +++ b/nw/gui/dochighlight.py @@ -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 diff --git a/nw/gui/projtree.py b/nw/gui/projtree.py index b7b9029c..02e850ad 100644 --- a/nw/gui/projtree.py +++ b/nw/gui/projtree.py @@ -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): diff --git a/nw/gui/statusbar.py b/nw/gui/statusbar.py index a7fbc342..a40e4022 100644 --- a/nw/gui/statusbar.py +++ b/nw/gui/statusbar.py @@ -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() diff --git a/nw/gui/theme.py b/nw/gui/theme.py index 78b2b44d..98c9a7b9 100644 --- a/nw/gui/theme.py +++ b/nw/gui/theme.py @@ -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 diff --git a/nw/guimain.py b/nw/guimain.py index e34ff448..576cd990 100644 --- a/nw/guimain.py +++ b/nw/guimain.py @@ -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):