Skip to content

Instantly share code, notes, and snippets.

@chihiro-adachi
Created October 21, 2016 11:18
Show Gist options
  • Save chihiro-adachi/7cc70e4b8174e17a19dbd5d65e3c2b90 to your computer and use it in GitHub Desktop.
Save chihiro-adachi/7cc70e4b8174e17a19dbd5d65e3c2b90 to your computer and use it in GitHub Desktop.
<?php
if (function_exists('eccube_log_info') === false) {
function eccube_log_emergency($message, array $context = array())
{
$GLOBALS['eccube_logger']->emergency($message, $context);
}
function eccube_log_alert($message, array $context = array())
{
$GLOBALS['eccube_logger']->alert($message, $context);
}
function eccube_log_critical($message, array $context = array())
{
$GLOBALS['eccube_logger']->critical($message, $context);
}
function eccube_log_error($message, array $context = array())
{
$GLOBALS['eccube_logger']->error($message, $context);
}
function eccube_log_warning($message, array $context = array())
{
$GLOBALS['eccube_logger']->warning($message, $context);
}
function eccube_log_notice($message, array $context = array())
{
$GLOBALS['eccube_logger']->notice($message, $context);
}
function eccube_log_info($message, array $context = array())
{
$GLOBALS['eccube_logger']->info($message, $context);
}
function eccube_log_debug($message, array $context = array())
{
$GLOBALS['eccube_logger']->debug($message, $context);
}
function eccube_log_init($app)
{
if (isset($GLOBALS['eccube_logger'])) {
return;
}
$GLOBALS['eccube_logger'] = $app['monolog'];
$app['eccube.monolog.factory'] = $app->protect(function ($config) use ($app) {
return $app['monolog'];
});
}
// 3.0.9以上の場合は初期化処理を行う.
if (method_exists('Eccube\Application', 'getInstance')) {
$app = \Eccube\Application::getInstance();
eccube_log_init($app);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment