Skip to content

Commit

Permalink
Update the compat logger to the latest version of SSP.
Browse files Browse the repository at this point in the history
SimpleSAML_Logger has been refactored to use namespaces. Replace all calls to the old class with the new.
  • Loading branch information
jaimeperez committed Jul 26, 2016
1 parent c31766d commit 00e38f8
Showing 1 changed file with 24 additions and 25 deletions.
49 changes: 24 additions & 25 deletions src/SAML2/Compat/Ssp/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace SAML2\Compat\Ssp;

use Psr\Log\LoggerInterface;
use SimpleSAML_Logger;

class Logger implements LoggerInterface
{
Expand All @@ -16,7 +15,7 @@ class Logger implements LoggerInterface
*/
public function emergency($message, array $context = array())
{
SimpleSAML_Logger::emergency($message . var_export($context, true));
\SimpleSAML\Logger::emergency($message . var_export($context, true));
}

/**
Expand All @@ -31,7 +30,7 @@ public function emergency($message, array $context = array())
*/
public function alert($message, array $context = array())
{
SimpleSAML_Logger::alert($message . var_export($context, true));
\SimpleSAML\Logger::alert($message . var_export($context, true));
}

/**
Expand All @@ -45,7 +44,7 @@ public function alert($message, array $context = array())
*/
public function critical($message, array $context = array())
{
SimpleSAML_Logger::critical($message . var_export($context, true));
\SimpleSAML\Logger::critical($message . var_export($context, true));
}

/**
Expand All @@ -58,7 +57,7 @@ public function critical($message, array $context = array())
*/
public function error($message, array $context = array())
{
SimpleSAML_Logger::error($message . var_export($context, true));
\SimpleSAML\Logger::error($message . var_export($context, true));
}

/**
Expand All @@ -73,7 +72,7 @@ public function error($message, array $context = array())
*/
public function warning($message, array $context = array())
{
SimpleSAML_Logger::warning($message . var_export($context, true));
\SimpleSAML\Logger::warning($message . var_export($context, true));
}

/**
Expand All @@ -85,7 +84,7 @@ public function warning($message, array $context = array())
*/
public function notice($message, array $context = array())
{
SimpleSAML_Logger::notice($message . var_export($context, true));
\SimpleSAML\Logger::notice($message . var_export($context, true));
}

/**
Expand All @@ -99,7 +98,7 @@ public function notice($message, array $context = array())
*/
public function info($message, array $context = array())
{
SimpleSAML_Logger::info($message . var_export($context, true));
\SimpleSAML\Logger::info($message . var_export($context, true));
}

/**
Expand All @@ -111,7 +110,7 @@ public function info($message, array $context = array())
*/
public function debug($message, array $context = array())
{
SimpleSAML_Logger::debug($message . var_export($context, true));
\SimpleSAML\Logger::debug($message . var_export($context, true));
}

/**
Expand All @@ -125,29 +124,29 @@ public function debug($message, array $context = array())
public function log($level, $message, array $context = array())
{
switch ($level) {
case SimpleSAML_Logger::ALERT:
SimpleSAML_Logger::alert($message);
case \SimpleSAML\Logger::ALERT:
\SimpleSAML\Logger::alert($message);
break;
case SimpleSAML_Logger::CRIT:
SimpleSAML_Logger::critical($message);
case \SimpleSAML\Logger::CRIT:
\SimpleSAML\Logger::critical($message);
break;
case SimpleSAML_Logger::DEBUG:
SimpleSAML_Logger::debug($message);
case \SimpleSAML\Logger::DEBUG:
\SimpleSAML\Logger::debug($message);
break;
case SimpleSAML_Logger::EMERG:
SimpleSAML_Logger::emergency($message);
case \SimpleSAML\Logger::EMERG:
\SimpleSAML\Logger::emergency($message);
break;
case SimpleSAML_Logger::ERR:
SimpleSAML_Logger::error($message);
case \SimpleSAML\Logger::ERR:
\SimpleSAML\Logger::error($message);
break;
case SimpleSAML_Logger::INFO:
SimpleSAML_Logger::info($message);
case \SimpleSAML\Logger::INFO:
\SimpleSAML\Logger::info($message);
break;
case SimpleSAML_Logger::NOTICE:
SimpleSAML_Logger::notice($message);
case \SimpleSAML\Logger::NOTICE:
\SimpleSAML\Logger::notice($message);
break;
case SimpleSAML_Logger::WARNING:
SimpleSAML_Logger::warning($message);
case \SimpleSAML\Logger::WARNING:
\SimpleSAML\Logger::warning($message);
}
}
}

0 comments on commit 00e38f8

Please sign in to comment.