jenkins-bot has submitted this change and it was merged.

Change subject: Provide VRS objects with a name for more informative 
debugging/logging
......................................................................


Provide VRS objects with a name for more informative debugging/logging

Bug: T112330
Change-Id: Iaa3af55ebc426d54e8bef94dba5415bc535e096b
---
M includes/libs/virtualrest/ParsoidVirtualRESTService.php
M includes/libs/virtualrest/RestbaseVirtualRESTService.php
M includes/libs/virtualrest/SwiftVirtualRESTService.php
M includes/libs/virtualrest/VirtualRESTService.php
4 files changed, 18 insertions(+), 1 deletion(-)

Approvals:
  Subramanya Sastry: Looks good to me, but someone else must approve
  Alex Monk: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/libs/virtualrest/ParsoidVirtualRESTService.php 
b/includes/libs/virtualrest/ParsoidVirtualRESTService.php
index 2a179be..43dfab3 100644
--- a/includes/libs/virtualrest/ParsoidVirtualRESTService.php
+++ b/includes/libs/virtualrest/ParsoidVirtualRESTService.php
@@ -54,6 +54,7 @@
                }
                // set up defaults and merge them with the given params
                $mparams = array_merge( array(
+                       'name' => 'parsoid',
                        'url' => 'http://localhost:8000/',
                        'prefix' => 'localhost',
                        'domain' => 'localhost',
diff --git a/includes/libs/virtualrest/RestbaseVirtualRESTService.php 
b/includes/libs/virtualrest/RestbaseVirtualRESTService.php
index bc520aa..3a7bc58 100644
--- a/includes/libs/virtualrest/RestbaseVirtualRESTService.php
+++ b/includes/libs/virtualrest/RestbaseVirtualRESTService.php
@@ -48,6 +48,7 @@
        public function __construct( array $params ) {
                // set up defaults and merge them with the given params
                $mparams = array_merge( array(
+                       'name' => 'restbase',
                        'url' => 'http://localhost:7231/',
                        'domain' => 'localhost',
                        'timeout' => 100,
diff --git a/includes/libs/virtualrest/SwiftVirtualRESTService.php 
b/includes/libs/virtualrest/SwiftVirtualRESTService.php
index 011dabe..88b0e1f 100644
--- a/includes/libs/virtualrest/SwiftVirtualRESTService.php
+++ b/includes/libs/virtualrest/SwiftVirtualRESTService.php
@@ -45,7 +45,11 @@
         *   - swiftAuthTTL       : Swift authentication TTL (seconds)
         */
        public function __construct( array $params ) {
-               parent::__construct( $params );
+               // set up defaults and merge them with the given params
+               $mparams = array_merge( array(
+                       'name' => 'swift'
+               ), $params );
+               parent::__construct( $mparams );
        }
 
        /**
diff --git a/includes/libs/virtualrest/VirtualRESTService.php 
b/includes/libs/virtualrest/VirtualRESTService.php
index 2a0b3f0..01a4ea6 100644
--- a/includes/libs/virtualrest/VirtualRESTService.php
+++ b/includes/libs/virtualrest/VirtualRESTService.php
@@ -45,6 +45,17 @@
        }
 
        /**
+        * Return the name of this service, in a form suitable for error
+        * reporting or debugging.
+        *
+        * @return string The name of the service behind this VRS object.
+        */
+       public function getName() {
+               return isset( $this->params['name'] ) ? $this->params['name'] :
+                       get_class( $this );
+       }
+
+       /**
         * Prepare virtual HTTP(S) requests (for this service) for execution
         *
         * This method should mangle any of the $reqs entry fields as needed:

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iaa3af55ebc426d54e8bef94dba5415bc535e096b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Cscott <canan...@wikimedia.org>
Gerrit-Reviewer: Alex Monk <kren...@gmail.com>
Gerrit-Reviewer: Cscott <canan...@wikimedia.org>
Gerrit-Reviewer: GWicke <gwi...@wikimedia.org>
Gerrit-Reviewer: Subramanya Sastry <ssas...@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