summaryrefslogtreecommitdiffstats
path: root/lib/private/Template
diff options
context:
space:
mode:
authorCôme Chilliet <come.chilliet@nextcloud.com>2022-03-17 16:42:53 +0100
committerCôme Chilliet <come.chilliet@nextcloud.com>2022-03-24 16:21:25 +0100
commit6be7aa112f6174c1406cfef5449836124a7f6f50 (patch)
tree5029bf9659caeab8702e9fabbbdeb9a2cd849bfa /lib/private/Template
parentfbf1334dc8c192ebdd335663cacfb810daf4d841 (diff)
downloadnextcloud-server-6be7aa112f6174c1406cfef5449836124a7f6f50.tar.gz
nextcloud-server-6be7aa112f6174c1406cfef5449836124a7f6f50.zip
Migrate from ILogger to LoggerInterface in lib/private
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
Diffstat (limited to 'lib/private/Template')
-rw-r--r--lib/private/Template/CSSResourceLocator.php5
-rw-r--r--lib/private/Template/IconsCacher.php11
-rw-r--r--lib/private/Template/JSCombiner.php14
-rw-r--r--lib/private/Template/JSResourceLocator.php4
-rwxr-xr-xlib/private/Template/ResourceLocator.php8
-rw-r--r--lib/private/Template/SCSSCacher.php21
6 files changed, 21 insertions, 42 deletions
diff --git a/lib/private/Template/CSSResourceLocator.php b/lib/private/Template/CSSResourceLocator.php
index 9ee11e723e5..a038ba7ce9b 100644
--- a/lib/private/Template/CSSResourceLocator.php
+++ b/lib/private/Template/CSSResourceLocator.php
@@ -31,7 +31,7 @@
*/
namespace OC\Template;
-use OCP\ILogger;
+use Psr\Log\LoggerInterface;
class CSSResourceLocator extends ResourceLocator {
@@ -39,13 +39,12 @@ class CSSResourceLocator extends ResourceLocator {
protected $scssCacher;
/**
- * @param ILogger $logger
* @param string $theme
* @param array $core_map
* @param array $party_map
* @param SCSSCacher $scssCacher
*/
- public function __construct(ILogger $logger, $theme, $core_map, $party_map, $scssCacher) {
+ public function __construct(LoggerInterface $logger, $theme, $core_map, $party_map, $scssCacher) {
$this->scssCacher = $scssCacher;
parent::__construct($logger, $theme, $core_map, $party_map);
diff --git a/lib/private/Template/IconsCacher.php b/lib/private/Template/IconsCacher.php
index 01500aa2e9c..01a6b714703 100644
--- a/lib/private/Template/IconsCacher.php
+++ b/lib/private/Template/IconsCacher.php
@@ -36,13 +36,12 @@ use OCP\Files\IAppData;
use OCP\Files\NotFoundException;
use OCP\Files\SimpleFS\ISimpleFile;
use OCP\Files\SimpleFS\ISimpleFolder;
-use OCP\ILogger;
use OCP\IURLGenerator;
+use Psr\Log\LoggerInterface;
class IconsCacher {
- /** @var ILogger */
- protected $logger;
+ protected LoggerInterface $logger;
/** @var IAppData */
protected $appData;
@@ -68,13 +67,9 @@ class IconsCacher {
private $cachedList;
/**
- * @param ILogger $logger
- * @param Factory $appDataFactory
- * @param IURLGenerator $urlGenerator
- * @param ITimeFactory $timeFactory
* @throws \OCP\Files\NotPermittedException
*/
- public function __construct(ILogger $logger,
+ public function __construct(LoggerInterface $logger,
Factory $appDataFactory,
IURLGenerator $urlGenerator,
ITimeFactory $timeFactory) {
diff --git a/lib/private/Template/JSCombiner.php b/lib/private/Template/JSCombiner.php
index d2073fbbb83..a6d9f0ee558 100644
--- a/lib/private/Template/JSCombiner.php
+++ b/lib/private/Template/JSCombiner.php
@@ -33,8 +33,8 @@ use OCP\Files\NotPermittedException;
use OCP\Files\SimpleFS\ISimpleFolder;
use OCP\ICache;
use OCP\ICacheFactory;
-use OCP\ILogger;
use OCP\IURLGenerator;
+use Psr\Log\LoggerInterface;
class JSCombiner {
@@ -50,24 +50,16 @@ class JSCombiner {
/** @var SystemConfig */
protected $config;
- /** @var ILogger */
- protected $logger;
+ protected LoggerInterface $logger;
/** @var ICacheFactory */
private $cacheFactory;
- /**
- * @param IAppData $appData
- * @param IURLGenerator $urlGenerator
- * @param ICacheFactory $cacheFactory
- * @param SystemConfig $config
- * @param ILogger $logger
- */
public function __construct(IAppData $appData,
IURLGenerator $urlGenerator,
ICacheFactory $cacheFactory,
SystemConfig $config,
- ILogger $logger) {
+ LoggerInterface $logger) {
$this->appData = $appData;
$this->urlGenerator = $urlGenerator;
$this->cacheFactory = $cacheFactory;
diff --git a/lib/private/Template/JSResourceLocator.php b/lib/private/Template/JSResourceLocator.php
index bf84e1ae958..95ae0d3d832 100644
--- a/lib/private/Template/JSResourceLocator.php
+++ b/lib/private/Template/JSResourceLocator.php
@@ -27,12 +27,14 @@
*/
namespace OC\Template;
+use Psr\Log\LoggerInterface;
+
class JSResourceLocator extends ResourceLocator {
/** @var JSCombiner */
protected $jsCombiner;
- public function __construct(\OCP\ILogger $logger, $theme, array $core_map, array $party_map, JSCombiner $JSCombiner) {
+ public function __construct(LoggerInterface $logger, $theme, array $core_map, array $party_map, JSCombiner $JSCombiner) {
parent::__construct($logger, $theme, $core_map, $party_map);
$this->jsCombiner = $JSCombiner;
diff --git a/lib/private/Template/ResourceLocator.php b/lib/private/Template/ResourceLocator.php
index 3ca34259907..5a50cc6fd1b 100755
--- a/lib/private/Template/ResourceLocator.php
+++ b/lib/private/Template/ResourceLocator.php
@@ -29,6 +29,8 @@
*/
namespace OC\Template;
+use Psr\Log\LoggerInterface;
+
abstract class ResourceLocator {
protected $theme;
@@ -39,16 +41,14 @@ abstract class ResourceLocator {
protected $resources = [];
- /** @var \OCP\ILogger */
- protected $logger;
+ protected LoggerInterface $logger;
/**
- * @param \OCP\ILogger $logger
* @param string $theme
* @param array $core_map
* @param array $party_map
*/
- public function __construct(\OCP\ILogger $logger, $theme, $core_map, $party_map) {
+ public function __construct(LoggerInterface $logger, $theme, $core_map, $party_map) {
$this->logger = $logger;
$this->theme = $theme;
$this->mapping = $core_map + $party_map;
diff --git a/lib/private/Template/SCSSCacher.php b/lib/private/Template/SCSSCacher.php
index 536557e7a3d..8b691cdb213 100644
--- a/lib/private/Template/SCSSCacher.php
+++ b/lib/private/Template/SCSSCacher.php
@@ -41,16 +41,15 @@ use OCP\Files\SimpleFS\ISimpleFolder;
use OCP\ICache;
use OCP\ICacheFactory;
use OCP\IConfig;
-use OCP\ILogger;
use OCP\IMemcache;
use OCP\IURLGenerator;
+use Psr\Log\LoggerInterface;
use ScssPhp\ScssPhp\Compiler;
use ScssPhp\ScssPhp\OutputStyle;
class SCSSCacher {
- /** @var ILogger */
- protected $logger;
+ protected LoggerInterface $logger;
/** @var IAppData */
protected $appData;
@@ -91,17 +90,9 @@ class SCSSCacher {
private $appConfig;
/**
- * @param ILogger $logger
- * @param Factory $appDataFactory
- * @param IURLGenerator $urlGenerator
- * @param IConfig $config
- * @param \OC_Defaults $defaults
* @param string $serverRoot
- * @param ICacheFactory $cacheFactory
- * @param IconsCacher $iconsCacher
- * @param ITimeFactory $timeFactory
*/
- public function __construct(ILogger $logger,
+ public function __construct(LoggerInterface $logger,
Factory $appDataFactory,
IURLGenerator $urlGenerator,
IConfig $config,
@@ -340,7 +331,7 @@ class SCSSCacher {
'@import "functions.scss";' .
'@import "' . $fileNameSCSS . '";');
} catch (\Exception $e) {
- $this->logger->logException($e, ['app' => 'scss_cacher']);
+ $this->logger->error($e->getMessage(), ['app' => 'scss_cacher', 'exception' => $e]);
return false;
}
@@ -395,7 +386,7 @@ class SCSSCacher {
try {
$file->delete();
} catch (NotPermittedException $e) {
- $this->logger->logException($e, ['message' => 'SCSSCacher::resetCache unable to delete file: ' . $file->getName(), 'app' => 'scss_cacher']);
+ $this->logger->error('SCSSCacher::resetCache unable to delete file: ' . $file->getName(), ['exception' => $e, 'app' => 'scss_cacher']);
}
}
}
@@ -431,7 +422,7 @@ class SCSSCacher {
$scss->compile($variables);
$this->injectedVariables = $variables;
} catch (\Exception $e) {
- $this->logger->logException($e, ['app' => 'scss_cacher']);
+ $this->logger->error($e->getMessage(), ['exception' => $e, 'app' => 'scss_cacher']);
}
return $variables;