aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-09-01 17:01:04 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2022-09-01 17:01:04 -0400
commitce8a43b22eb68c03d57bcd810b2c3bde1431634c (patch)
tree3523be66c60d7f5a2f07fc6e22a1d07d3e67cb0f
parenta68fc5d69c67c5b79206a274e834d1d2856c932d (diff)
downloadb4-ce8a43b22eb68c03d57bcd810b2c3bde1431634c.tar.gz
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 <konstantin@linuxfoundation.org>
-rw-r--r--b4/__init__.py9
1 files 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