Skip to content

Commit

Permalink
Improve display of error
Browse files Browse the repository at this point in the history
  • Loading branch information
simoncozens committed Nov 1, 2023
1 parent 554ac19 commit 9fec303
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Lib/fontmake/compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,17 @@ def ensure_all_same(self, func, objs, what):
if len(values) < 2:
logger.debug(f"All fonts had same {what} in {context}")
return True
logger.error(f"Fonts had differing {what} in {context}:")
report = f"\nFonts had differing {what} in {context}:\n"
debug_enabled = logger.isEnabledFor(logging.DEBUG)
for value, fonts in values.items():
if debug_enabled or len(fonts) <= 6:
key = ", ".join(fonts)
else:
key = f"{len(fonts)} fonts"
logger.error(f" * {key} had {value}")
if len(str(value)) > 20:
value = "\n " + str(value)
report += f" * {key} had: {value}\n"
logger.error(report)
self.okay = False
return False

Expand Down

0 comments on commit 9fec303

Please sign in to comment.