Skip to content
Snippets Groups Projects
Commit b9a76680 authored by Piotr Po's avatar Piotr Po
Browse files

fix: simpleLoggerFactory

parent 6eb93aab
No related branches found
No related tags found
1 merge request!17fix: simpleLoggerFactory
Pipeline #7474 passed
......@@ -14,19 +14,23 @@ final class SimpleLoggerFactory implements LoggerFactory {
/** @var Settings */
private $options;
/** @var string */
private $channel;
/** @var Logger */
private $logger;
public function __construct( Settings $options = null ) {
public function __construct( string $channel, Settings $options = null ) {
$this->channel = $channel;
$this->options = $options ?? new Settings();
}
public function getLogger( $channel ): Logger {
public function getLogger( $name = null ): Logger {
if ( $this->logger ) {
return $this->logger;
}
$logger = new Logger( $channel );
$logger = new Logger( $this->channel );
$wc_handler = $this->get_wc_handler();
if ( $this->options->use_wc_log ) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment