Ejegg has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/339484 )
Change subject: Set SmashPig logging prefix ...................................................................... Set SmashPig logging prefix Not perfect, as it happens after any SmashPig library calls that happen in the gateway object constructor. Trying to keep the silly static stuff near the surface, or I'd set the prefix right after creating the DonationData object. Change-Id: Ie458247c806bcf9d7a2bbe9439489f6b34eb2f14 --- M gateway_common/GatewayPage.php M gateway_common/donation.api.php 2 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/DonationInterface refs/changes/84/339484/1 diff --git a/gateway_common/GatewayPage.php b/gateway_common/GatewayPage.php index 5dbc747..2d39490 100644 --- a/gateway_common/GatewayPage.php +++ b/gateway_common/GatewayPage.php @@ -15,6 +15,7 @@ * GNU General Public License for more details. * */ +use SmashPig\Core\Logging\Logger; /** * GatewayPage @@ -82,6 +83,10 @@ try { $this->adapter = new $className(); $this->logger = DonationLoggerFactory::getLogger( $this->adapter ); + + // FIXME: SmashPig should just use Monolog. + Logger::getContext()->enterContext( $this->adapter->getLogMessagePrefix() ); + $out = $this->getOutput(); $out->addModuleStyles( 'donationInterface.styles' ); $out->addModules( 'donationInterface.skinOverride' ); diff --git a/gateway_common/donation.api.php b/gateway_common/donation.api.php index 9f41ded..d560699 100644 --- a/gateway_common/donation.api.php +++ b/gateway_common/donation.api.php @@ -1,4 +1,6 @@ <?php +use SmashPig\Core\Logging\Logger; + /** * Generic Donation API * This API should be able to accept donation submissions for any gateway or payment type @@ -18,6 +20,9 @@ DonationInterface::initializeSmashPig( $this->gateway ); $gatewayObj = $this->getGatewayObject(); + // FIXME: SmashPig should just use Monolog. + Logger::getContext()->enterContext( $gatewayObj->getLogMessagePrefix() ); + if ( !$gatewayObj ) { return; // already failed with a dieUsage call } -- To view, visit https://gerrit.wikimedia.org/r/339484 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie458247c806bcf9d7a2bbe9439489f6b34eb2f14 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/DonationInterface Gerrit-Branch: master Gerrit-Owner: Ejegg <eeggles...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits