Skip to content

Commit

Permalink
1.37.1
Browse files Browse the repository at this point in the history
[+] always logging to Logging Channel.
  • Loading branch information
wombat committed Sep 24, 2019
1 parent 130b7be commit f43d1a5
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions sources/Toolkit/NginxToolkit.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,21 +129,21 @@ public static function clear_nginx_cache(string $url)
$cache_filepath .= "/{$cache_filename}";

if (file_exists($cache_filepath)) {
if (self::$is_logging && self::$LOGGER instanceof \Monolog\Logger) {
if (self::$LOGGER instanceof \Monolog\Logger) {
self::$LOGGER->debug("NGINX Cache Force Cleaner: cached data present: ", [ $cache_filepath ]);
}

$unlink_status = unlink($cache_filepath);

} else {
if (self::$is_logging && self::$LOGGER instanceof \Monolog\Logger) {
if (self::$LOGGER instanceof \Monolog\Logger) {
self::$LOGGER->debug("NGINX Cache Force Cleaner: cached data not found: ", [ $cache_filepath ]);
}

$unlink_status = true;
}

if (self::$is_logging && self::$LOGGER instanceof \Monolog\Logger) {
if (self::$LOGGER instanceof \Monolog\Logger) {
self::$LOGGER->debug("NGINX Cache Force Cleaner: Clear status (key/status)", [$cache_key, $unlink_status]);
}

Expand All @@ -159,7 +159,7 @@ public static function clear_nginx_cache_entire()
{
$unlink_status = true;

if (self::$is_logging && self::$LOGGER instanceof \Monolog\Logger) {
if (self::$LOGGER instanceof \Monolog\Logger) {
self::$LOGGER->debug("NGINX Cache Force Cleaner: requested clean whole cache");
}

Expand All @@ -171,8 +171,8 @@ public static function clear_nginx_cache_entire()
}
}

if (self::$is_logging && self::$LOGGER instanceof \Monolog\Logger) {
self::$LOGGER->debug("NGINX Cache Force Cleaner: whole cache clean status: ", [self::$nginx_cache_root, $unlink_status]);
if (self::$LOGGER instanceof \Monolog\Logger) {
self::$LOGGER->debug("NGINX Cache Force Cleaner: whole cache clean status: ", [ self::$nginx_cache_root, $unlink_status ]);
}

return $unlink_status;
Expand All @@ -187,7 +187,7 @@ public static function clear_nginx_cache_entire()
public static function rmdir(string $directory): bool
{
if (!is_dir($directory)) {
if (self::$is_logging && self::$LOGGER instanceof \Monolog\Logger) {
if (self::$LOGGER instanceof \Monolog\Logger) {
self::$LOGGER->warning(__METHOD__ . ' throws warning: no such file or directory', [ $directory ]);
}

Expand Down

0 comments on commit f43d1a5

Please sign in to comment.