Skip to content
Snippets Groups Projects

fix: simpleLoggerFactory

Merged Krzysztof Dyszczyk requested to merge fix/simple-logger into master
1 unresolved thread
2 files
+ 8
8
Compare changes
  • Side-by-side
  • Inline

Files

+ 4
8
<?php
declare(strict_types=1);
declare( strict_types=1 );
namespace WPDesk\Logger;
@@ -14,23 +14,19 @@ final class SimpleLoggerFactory implements LoggerFactory {
/** @var Settings */
private $options;
/** @var string */
private $channel;
/** @var Logger */
private $logger;
public function __construct( string $channel, Settings $options = null ) {
$this->channel = $channel;
public function __construct( Settings $options = null ) {
$this->options = $options ?? new Settings();
}
public function getLogger( string $channel, Settings $options = null ): Logger {
public function getLogger( $channel ): Logger {
if ( $this->logger ) {
return $this->logger;
}
$logger = new Logger( $this->channel );
$logger = new Logger( $channel );
$wc_handler = $this->get_wc_handler();
if ( $this->options->use_wc_log ) {
Loading