Skip to content

Commit

Permalink
Merge pull request #8 from onshopVN/onshop/feature_support_oscore
Browse files Browse the repository at this point in the history
Remove extend log function due to new approach (try to minimize diffe…
  • Loading branch information
ndquocphong authored Oct 23, 2019
2 parents 067bca0 + f8c78b1 commit f47b151
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions src/Eccube/Log/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

class Logger extends AbstractLogger
{
use \Plugin\OSCore\Event\EventTrait;
/**
* @var Context
*/
Expand Down Expand Up @@ -61,27 +60,6 @@ public function __construct(
*/
public function log($level, $message, array $context = [])
{
/** @var \Plugin\OSCore\Event\LoggerArgumentsEvent $event */
$event = $this->eventManager->dispatch(new \Plugin\OSCore\Event\LoggerArgumentsEvent($level, $message, $context));
$level = $event->getLevel();
$message = $event->getMessage();
$context = $event->getContext();
if (is_string($level)) {
$validLevels = [
\Psr\Log\LogLevel::EMERGENCY,
\Psr\Log\LogLevel::ALERT,
\Psr\Log\LogLevel::CRITICAL,
\Psr\Log\LogLevel::ERROR,
\Psr\Log\LogLevel::WARNING,
\Psr\Log\LogLevel::NOTICE,
\Psr\Log\LogLevel::INFO,
\Psr\Log\LogLevel::DEBUG,
];
if (!in_array($event->getLevel(), $validLevels)) {
return;
}
}

if ($this->context->isAdmin()) {
$this->adminLogger->log($level, $message, $context);
} elseif ($this->context->isFront()) {
Expand Down

0 comments on commit f47b151

Please sign in to comment.