Commit 5cd9c2e4 authored by Michael Iseard's avatar Michael Iseard
Browse files

Add more logging

parent 7c773970
......@@ -37,6 +37,9 @@ class ActivatorService {
self::create_subscriptions_table();
self::set_defaults();
$logger = new LoggerService();
$logger->info('Kudos Donations plugin activated');
}
/**
......
......@@ -28,11 +28,8 @@ class DeactivatorService {
* @since 1.0.0
*/
public static function deactivate() {
// Clean-up settings from database
$settings = new Settings();
$settings->remove_settings();
$logger = new LoggerService();
$logger->info('Kudos Donations plugin deactivated');
}
}
......@@ -34,7 +34,14 @@ class LoggerService extends Monolog {
*/
public static function init() {
wp_mkdir_p(self::LOG_DIR);
$logger = new LoggerService();
if(wp_mkdir_p(self::LOG_DIR)) {
$logger->info('Log directory created successfully');
return;
}
error_log('Unable to create Kudos Donations log directory: ' . self::LOG_DIR);
}
......
......@@ -11,7 +11,7 @@ use Twig\TwigFunction;
class TwigService {
const CACHE_DIR = KUDOS_STORAGE_DIR . '/twig/cache/';
const CACHE_DIR = KUDOS_STORAGE_DIR . 'twig/cache/';
/**
* @var Environment
......@@ -49,7 +49,14 @@ class TwigService {
*/
public static function init() {
wp_mkdir_p(self::CACHE_DIR);
$logger = new LoggerService();
if(wp_mkdir_p(self::CACHE_DIR)) {
$logger->info('Twig cache directory created successfully');
return;
}
$logger->error('Unable to create Kudos Donations Twig cache directory', [self::CACHE_DIR]);
}
......
Supports Markdown
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