jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/386689 )

Change subject: Group XMP parse failures by exception message
......................................................................


Group XMP parse failures by exception message

Change-Id: I2bba40ded5c90f2e19a32bb5540e3c441b605da6
---
M includes/libs/xmp/XMP.php
1 file changed, 11 insertions(+), 7 deletions(-)

Approvals:
  BryanDavis: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/libs/xmp/XMP.php b/includes/libs/xmp/XMP.php
index c46acc6..0cc1466 100644
--- a/includes/libs/xmp/XMP.php
+++ b/includes/libs/xmp/XMP.php
@@ -388,7 +388,7 @@
                        }
                } catch ( Exception $e ) {
                        $this->logger->warning(
-                               '{method} Exception caught while parsing: ' . 
$e->getMessage(),
+                               '{method} {exception}',
                                [
                                        'method' => __METHOD__,
                                        'exception' => $e,
@@ -420,7 +420,8 @@
                        || $this->results['xmp-special']['HasExtendedXMP'] !== 
$guid
                ) {
                        $this->logger->info( __METHOD__ .
-                               " Ignoring XMPExtended block due to wrong guid 
(guid= '$guid')" );
+                               " Ignoring XMPExtended block due to wrong guid 
(guid= '{guid}')",
+                               [ 'guid' => 'guid' ] );
 
                        return false;
                }
@@ -954,8 +955,8 @@
                } else {
                        // something else we don't recognize, like a qualifier 
maybe.
                        $this->logger->info( __METHOD__ .
-                               " Encountered element <$elm> where only 
expecting character data as value of " .
-                               $this->curItem[0] );
+                               " Encountered element <{element}> where only 
expecting character data as value of {curitem}",
+                               [ 'element' => $elm, 'curitem' => 
$this->curItem[0] ] );
                        array_unshift( $this->mode, self::MODE_IGNORE );
                        array_unshift( $this->curItem, $elm );
                }
@@ -1005,8 +1006,10 @@
                                        // a child of a struct), then something 
weird is
                                        // happening, so ignore this element 
and its children.
 
-                                       $this->logger->warning( "Encountered 
<$ns:$tag> outside"
-                                               . " of its expected parent. 
Ignoring." );
+                                       $this->logger->warning(
+                                               'Encountered <{element}> 
outside of its expected parent. Ignoring.',
+                                               [ 'element' => "$ns:$tag" ]
+                                       );
 
                                        array_unshift( $this->mode, 
self::MODE_IGNORE );
                                        array_unshift( $this->curItem, $ns . ' 
' . $tag );
@@ -1027,7 +1030,8 @@
                                }
                        } else {
                                // This element is not on our list of allowed 
elements so ignore.
-                               $this->logger->debug( __METHOD__ . " Ignoring 
unrecognized element <$ns:$tag>." );
+                               $this->logger->debug( __METHOD__ . ' Ignoring 
unrecognized element <{element}>.',
+                                       [ 'element' => "$ns:$tag" ] );
                                array_unshift( $this->mode, self::MODE_IGNORE );
                                array_unshift( $this->curItem, $ns . ' ' . $tag 
);
 

-- 
To view, visit https://gerrit.wikimedia.org/r/386689
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2bba40ded5c90f2e19a32bb5540e3c441b605da6
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: BryanDavis <bda...@wikimedia.org>
Gerrit-Reviewer: Chad <ch...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to