Skip to content

Commit

Permalink
Merge pull request #69 from LettError/issue_68
Browse files Browse the repository at this point in the history
loadFonts to check if there is a logger when debug==True
  • Loading branch information
LettError authored Dec 6, 2024
2 parents e8593dc + a08c050 commit 6f2a15f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Lib/ufoProcessor/ufoOperator.py
Original file line number Diff line number Diff line change
Expand Up @@ -399,6 +399,11 @@ def getAxis(self, axisName):
# loading and updating fonts
def loadFonts(self, reload=False):
# Load the fonts and find the default candidate based on the info flag
if self.logger is None and self.debug:
# in some cases the UFOProcessor is initialised without debug
# and then it is switched on afterwards. So have to check if
# we have a logger before proceding.
self.startLog()
self.glyphNames = list({glyphname for font in self.fonts.values() for glyphname in font.keys()})
if self._fontsLoaded and not reload:
if self.debug:
Expand Down Expand Up @@ -1761,8 +1766,12 @@ def _copyFontInfo(self, sourceInfo, targetInfo):
if ds5Path is None:
doc = UFOOperator()
else:
doc = UFOOperator(ds5Path, useVarlib=True, debug=debug)
doc = UFOOperator(ds5Path, useVarlib=True, debug=False)
print("Initialised without debug, no logger:", doc.logger)
doc.debug=True
print("Set debug to True, after initialisation:", doc.debug)
doc.loadFonts()
print("loadFonts checks and creates a logger if needed:", doc.logger)


# test the getLibEntryMutator
Expand Down

0 comments on commit 6f2a15f

Please sign in to comment.