mailpoet
/
vendor
/
woocommerce
/
email-editor
/
src
/
Engine
/
Logger
/
class-email-editor-logger.php
class-default-email-editor-logger.php
11 months ago
class-email-editor-logger-interface.php
11 months ago
class-email-editor-logger.php
11 months ago
index.php
11 months ago
class-email-editor-logger.php
41 lines
| 1 | <?php |
| 2 | declare(strict_types = 1); |
| 3 | namespace Automattic\WooCommerce\EmailEditor\Engine\Logger; |
| 4 | if (!defined('ABSPATH')) exit; |
| 5 | class Email_Editor_Logger implements Email_Editor_Logger_Interface { |
| 6 | private Email_Editor_Logger_Interface $logger; |
| 7 | public function __construct( ?Email_Editor_Logger_Interface $logger = null ) { |
| 8 | $this->logger = $logger ?? new Default_Email_Editor_Logger(); |
| 9 | } |
| 10 | public function set_logger( Email_Editor_Logger_Interface $logger ): void { |
| 11 | $this->logger = $logger; |
| 12 | } |
| 13 | public function emergency( string $message, array $context = array() ): void { |
| 14 | $this->logger->emergency( $message, $context ); |
| 15 | } |
| 16 | public function alert( string $message, array $context = array() ): void { |
| 17 | $this->logger->alert( $message, $context ); |
| 18 | } |
| 19 | public function critical( string $message, array $context = array() ): void { |
| 20 | $this->logger->critical( $message, $context ); |
| 21 | } |
| 22 | public function error( string $message, array $context = array() ): void { |
| 23 | $this->logger->error( $message, $context ); |
| 24 | } |
| 25 | public function warning( string $message, array $context = array() ): void { |
| 26 | $this->logger->warning( $message, $context ); |
| 27 | } |
| 28 | public function notice( string $message, array $context = array() ): void { |
| 29 | $this->logger->notice( $message, $context ); |
| 30 | } |
| 31 | public function info( string $message, array $context = array() ): void { |
| 32 | $this->logger->info( $message, $context ); |
| 33 | } |
| 34 | public function debug( string $message, array $context = array() ): void { |
| 35 | $this->logger->debug( $message, $context ); |
| 36 | } |
| 37 | public function log( string $level, string $message, array $context = array() ): void { |
| 38 | $this->logger->log( $level, $message, $context ); |
| 39 | } |
| 40 | } |
| 41 |