From ce8a43b22eb68c03d57bcd810b2c3bde1431634c Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Thu, 1 Sep 2022 17:01:04 -0400 Subject: trailers: improve debugging of mismatched trailers When we're adding a mismatched trailer, tell us why it hasn't been accepted. Signed-off-by: Konstantin Ryabitsev --- b4/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/b4/__init__.py b/b4/__init__.py index 903a74a..5b0bb6e 100644 --- a/b4/__init__.py +++ b/b4/__init__.py @@ -1093,9 +1093,9 @@ class LoreMessage: if trailer.lname not in badtrailers: self.trailers.append(trailer) - def get_trailers(self, sloppy: bool = False) -> Tuple[List[LoreTrailer], List[LoreTrailer]]: + def get_trailers(self, sloppy: bool = False) -> Tuple[List[LoreTrailer], Set[LoreTrailer]]: trailers = list() - mismatches = list() + mismatches = set() for ltr in self.trailers: ltr.lmsg = self @@ -1129,7 +1129,8 @@ class LoreMessage: trailers.append(ltr) continue - mismatches.append(ltr) + logger.debug('trailer did not match: %s: %s', ltr.name, ltr.value) + mismatches.add(ltr) return trailers, mismatches @@ -1561,7 +1562,7 @@ class LoreMessage: logger.debug('Ignoring %s (not a recognized non-person trailer)', line) continue if re.search(r'https?://', ovalue): - logger.debug('Ignoring a non-recognized link trailer') + logger.debug('Ignoring %s (not a recognized link trailer)', line) continue extinfo = None -- cgit v1.2.3