mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
33 lines
807 B
PHP
33 lines
807 B
PHP
<?php
|
|
/**
|
|
* The logging services.
|
|
*
|
|
* @package WooCommerce\WooCommerce\Logging
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace WooCommerce\WooCommerce\Logging;
|
|
|
|
use WooCommerce\WooCommerce\Logging\Logger\NullLogger;
|
|
use WooCommerce\WooCommerce\Logging\Logger\WooCommerceLogger;
|
|
use WooCommerce\PayPalCommerce\Vendor\Psr\Container\ContainerInterface;
|
|
use Psr\Log\LoggerInterface;
|
|
|
|
return array(
|
|
'woocommerce.logger.source' => function(): string {
|
|
return 'woocommerce-paypal-payments';
|
|
},
|
|
'woocommerce.logger.woocommerce' => function ( ContainerInterface $container ): LoggerInterface {
|
|
if ( ! class_exists( \WC_Logger::class ) ) {
|
|
return new NullLogger();
|
|
}
|
|
|
|
$source = $container->get( 'woocommerce.logger.source' );
|
|
|
|
return new WooCommerceLogger(
|
|
wc_get_logger(),
|
|
$source
|
|
);
|
|
},
|
|
);
|