Skip to content

Commit f31d3ba

Browse files
author
Илья
committed
Add logger as config
1 parent 30d8a68 commit f31d3ba

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/Ydb.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,11 @@ public function __construct($config = [], LoggerInterface $logger = null)
110110
if (!is_null($logger) && isset($config['logger'])){
111111
throw new \Exception('Logger set in 2 places');
112112
} else if (isset($config['logger'])) {
113-
$this->setLogger($config['logger']);
113+
$this->logger = $config['logger'];
114114
} else if ($logger) {
115-
$this->setLogger($logger);
115+
$this->logger = $logger;
116116
} else {
117-
$this->setLogger(new NullLogger());
117+
$this->logger = new NullLogger();
118118
}
119119

120120
$this->retry = new Retry($this->logger);
@@ -364,8 +364,4 @@ public function getLogger()
364364
return $this->logger;
365365
}
366366

367-
protected function setLogger(LoggerInterface $logger){
368-
$this->logger = $logger;
369-
}
370-
371367
}

0 commit comments

Comments
 (0)