Skip to content

Commit

Permalink
Fix getLogger method
Browse files Browse the repository at this point in the history
  • Loading branch information
TuzelKO committed Aug 29, 2019
1 parent 0c5846f commit 3e246ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.idea/
vendor/
composer.lock
4 changes: 3 additions & 1 deletion src/GitPHP/Backend.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace GitPHP;

use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Psr\Log\LoggerInterface;

class Backend {
Expand Down Expand Up @@ -75,7 +76,8 @@ public function setLogger(LoggerInterface $logger) {
private function getLogger() {

if (!isset($this->logger)) {
$this->logger = new Logger('php://stderr', Logger::NOTICE);
$this->logger = new Logger("Git-Backend");
$this->logger->pushHandler(new StreamHandler('php://stderr', Logger::NOTICE));
}

return $this->logger;
Expand Down

0 comments on commit 3e246ea

Please sign in to comment.