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; ...@@ -80,8 +80,7 @@ $tab = isset( $_GET['tab'] ) ? $_GET['tab'] : $default_tab;
$class = 'notice-error'; $class = 'notice-error';
break; break;
case 'DEBUG': case 'DEBUG':
$class = ''; $class = 'notice-debug';
$style = '';
break; break;
default: default:
$class = 'notice-' . strtolower( $level ); $class = 'notice-' . strtolower( $level );
......
...@@ -49,7 +49,7 @@ class ActivatorService { ...@@ -49,7 +49,7 @@ class ActivatorService {
self::create_subscriptions_table(); self::create_subscriptions_table();
update_option( '_kudos_donations_version', KUDOS_VERSION ); 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 { ...@@ -114,7 +114,7 @@ class LoggerService extends Monolog {
public function init() { public function init() {
if ( wp_mkdir_p( self::LOG_DIR ) ) { if ( wp_mkdir_p( self::LOG_DIR ) ) {
$this->info( 'Log directory created successfully' ); $this->info( 'Log directory created successfully', [self::LOG_DIR] );
return; return;
} }
......
...@@ -162,7 +162,7 @@ class TwigService extends AbstractService { ...@@ -162,7 +162,7 @@ class TwigService extends AbstractService {
$logger = $this->logger; $logger = $this->logger;
if ( wp_mkdir_p( self::CACHE_DIR ) ) { 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(); $this->clearCache();
return; return;
...@@ -211,7 +211,7 @@ class TwigService extends AbstractService { ...@@ -211,7 +211,7 @@ class TwigService extends AbstractService {
try { try {
return $this->twig->render( $template, $array ); return $this->twig->render( $template, $array );
} catch ( Throwable $e ) { } catch ( Throwable $e ) {
$this->logger->critical( $e->getMessage(), [ $template, $e->getLine() ] ); $this->logger->critical( $e->getMessage(), [ 'template' => $template, 'line' => $e->getLine() ] );
return false; 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