Commit 7ac0e2da authored by Michael Iseard's avatar Michael Iseard
Browse files

Various logging improvements

parent 4fedd56a
......@@ -80,8 +80,7 @@ $tab = isset( $_GET['tab'] ) ? $_GET['tab'] : $default_tab;
$class = 'notice-error';
break;
case 'DEBUG':
$class = '';
$style = '';
$class = 'notice-debug';
break;
default:
$class = 'notice-' . strtolower( $level );
......
......@@ -49,7 +49,7 @@ class ActivatorService {
self::create_subscriptions_table();
update_option( '_kudos_donations_version', KUDOS_VERSION );
$logger->info( 'Kudos Donations plugin activated' );
$logger->info( 'Kudos Donations plugin activated', ['version' => KUDOS_VERSION] );
}
......
......@@ -114,7 +114,7 @@ class LoggerService extends Monolog {
public function init() {
if ( wp_mkdir_p( self::LOG_DIR ) ) {
$this->info( 'Log directory created successfully' );
$this->info( 'Log directory created successfully', [self::LOG_DIR] );
return;
}
......
......@@ -162,7 +162,7 @@ class TwigService extends AbstractService {
$logger = $this->logger;
if ( wp_mkdir_p( self::CACHE_DIR ) ) {
$logger->info( 'Twig cache directory created successfully' );
$logger->info( 'Twig cache directory created successfully', [self::CACHE_DIR] );
$this->clearCache();
return;
......@@ -211,7 +211,7 @@ class TwigService extends AbstractService {
try {
return $this->twig->render( $template, $array );
} catch ( Throwable $e ) {
$this->logger->critical( $e->getMessage(), [ $template, $e->getLine() ] );
$this->logger->critical( $e->getMessage(), [ 'template' => $template, 'line' => $e->getLine() ] );
return false;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment