Navigation Menu

Skip to content

Commit

Permalink
fixed Logger when it is null
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Sep 14, 2011
1 parent 17f0abe commit 62d8d69
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions Logger/PropelLogger.php
Expand Up @@ -47,7 +47,9 @@ public function __construct(LoggerInterface $logger = null)
*/
public function alert($message)
{
$this->logger->alert($message);
if (null !== $this->logger) {
$this->logger->alert($message);
}
}

/**
Expand All @@ -57,7 +59,9 @@ public function alert($message)
*/
public function crit($message)
{
$this->logger->crit($message);
if (null !== $this->logger) {
$this->logger->crit($message);
}
}

/**
Expand All @@ -67,7 +71,9 @@ public function crit($message)
*/
public function err($message)
{
$this->logger->err($message);
if (null !== $this->logger) {
$this->logger->err($message);
}
}

/**
Expand All @@ -77,7 +83,9 @@ public function err($message)
*/
public function warning($message)
{
$this->logger->warn($message);
if (null !== $this->logger) {
$this->logger->warn($message);
}
}

/**
Expand All @@ -87,7 +95,9 @@ public function warning($message)
*/
public function notice($message)
{
$this->logger->notice($message);
if (null !== $this->logger) {
$this->logger->notice($message);
}
}

/**
Expand All @@ -97,7 +107,9 @@ public function notice($message)
*/
public function info($message)
{
$this->logger->info($message);
if (null !== $this->logger) {
$this->logger->info($message);
}
}

/**
Expand All @@ -108,7 +120,9 @@ public function info($message)
public function debug($message)
{
$this->queries[] = $message;
$this->logger->debug($message);
if (null !== $this->logger) {
$this->logger->debug($message);
}
}

/**
Expand Down

0 comments on commit 62d8d69

Please sign in to comment.