Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Michael Iseard
Kudos-Donations
Commits
5cd9c2e4
Commit
5cd9c2e4
authored
Sep 03, 2020
by
Michael Iseard
Browse files
Add more logging
parent
7c773970
Changes
4
Hide whitespace changes
Inline
Side-by-side
app/Service/ActivatorService.php
View file @
5cd9c2e4
...
...
@@ -37,6 +37,9 @@ class ActivatorService {
self
::
create_subscriptions_table
();
self
::
set_defaults
();
$logger
=
new
LoggerService
();
$logger
->
info
(
'Kudos Donations plugin activated'
);
}
/**
...
...
app/Service/DeactivatorService.php
View file @
5cd9c2e4
...
...
@@ -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'
);
}
}
app/Service/LoggerService.php
View file @
5cd9c2e4
...
...
@@ -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
);
}
...
...
app/Service/TwigService.php
View file @
5cd9c2e4
...
...
@@ -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
]);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment