From e1e1c589696298bf65749f704f7d852d9d924883 Mon Sep 17 00:00:00 2001
From: Florin Peter <github@florin-peter.de>
Date: Mon, 27 May 2013 20:51:52 +0200
Subject: [PATCH] changed to public log api

---
 apps/files_encryption/lib/crypt.php      |  8 ++++----
 apps/files_encryption/lib/helper.php     |  4 ++--
 apps/files_encryption/lib/keymanager.php | 16 ++++++++--------
 apps/files_encryption/lib/proxy.php      |  4 ++--
 4 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/apps/files_encryption/lib/crypt.php b/apps/files_encryption/lib/crypt.php
index 56d5e082e4..ddeb3590f6 100755
--- a/apps/files_encryption/lib/crypt.php
+++ b/apps/files_encryption/lib/crypt.php
@@ -206,7 +206,7 @@ class Crypt {
 
 		} else {
 
-			\OC_Log::write('Encryption library', 'Encryption (symmetric) of content failed', \OC_Log::ERROR);
+			\OCP\Util::writeLog('Encryption library', 'Encryption (symmetric) of content failed', \OCP\Util::ERROR);
 
 			return false;
 
@@ -305,7 +305,7 @@ class Crypt {
 
 		} else {
 
-			\OC_Log::write('Encryption library', 'Encryption (symmetric) of keyfile content failed', \OC_Log::ERROR);
+			\OCP\Util::writeLog('Encryption library', 'Encryption (symmetric) of keyfile content failed', \OCP\Util::ERROR);
 
 			return false;
 
@@ -452,7 +452,7 @@ class Crypt {
 
 		} else {
 
-			\OC_Log::write('Encryption library', 'Decryption (asymmetric) of sealed content failed', \OC_Log::ERROR);
+			\OCP\Util::writeLog('Encryption library', 'Decryption (asymmetric) of sealed content failed', \OCP\Util::ERROR);
 
 			return false;
 
@@ -503,7 +503,7 @@ class Crypt {
 			if (!$strong) {
 
 				// If OpenSSL indicates randomness is insecure, log error
-				\OC_Log::write('Encryption library', 'Insecure symmetric key was generated using openssl_random_pseudo_bytes()', \OC_Log::WARN);
+				\OCP\Util::writeLog('Encryption library', 'Insecure symmetric key was generated using openssl_random_pseudo_bytes()', \OCP\Util::WARN);
 
 			}
 
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php
index 5fa4583263..05172f5a38 100755
--- a/apps/files_encryption/lib/helper.php
+++ b/apps/files_encryption/lib/helper.php
@@ -72,8 +72,8 @@ class Helper {
 		// Check files_encryption infrastructure is ready for action
 		if (!$util->ready()) {
 
-			\OC_Log::write('Encryption library', 'User account "' . $util->getUserId()
-												 . '" is not ready for encryption; configuration started', \OC_Log::DEBUG);
+			\OCP\Util::writeLog('Encryption library', 'User account "' . $util->getUserId()
+												 . '" is not ready for encryption; configuration started', \OCP\Util::DEBUG);
 
 			if (!$util->setupServerSide($password)) {
 				return false;
diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php
index c7b431c352..9bb854325d 100755
--- a/apps/files_encryption/lib/keymanager.php
+++ b/apps/files_encryption/lib/keymanager.php
@@ -285,8 +285,8 @@ class Keymanager {
 
 		if (!$result) {
 
-			\OC_Log::write('Encryption library',
-				'Could not delete keyfile; does not exist: "' . $keyPath, \OC_Log::ERROR);
+			\OCP\Util::writeLog('Encryption library',
+				'Could not delete keyfile; does not exist: "' . $keyPath, \OCP\Util::ERROR);
 
 		}
 
@@ -475,8 +475,8 @@ class Keymanager {
 			foreach ($matches as $ma) {
 				$result = unlink($ma);
 				if (!$result) {
-					\OC_Log::write('Encryption library',
-						'Keyfile or shareKey could not be deleted for file "' . $filePath . '"', \OC_Log::ERROR);
+					\OCP\Util::writeLog('Encryption library',
+						'Keyfile or shareKey could not be deleted for file "' . $filePath . '"', \OCP\Util::ERROR);
 				}
 			}
 		}
@@ -507,9 +507,9 @@ class Keymanager {
 			foreach ($userIds as $userId) {
 
 				if (!$view->unlink($shareKeyPath . '.' . $userId . '.shareKey')) {
-					\OC_Log::write('Encryption library',
+					\OCP\Util::writeLog('Encryption library',
 						'Could not delete shareKey; does not exist: "' . $shareKeyPath . '.' . $userId
-						. '.shareKey"', \OC_Log::ERROR);
+						. '.shareKey"', \OCP\Util::ERROR);
 				}
 
 			}
@@ -531,8 +531,8 @@ class Keymanager {
 		/** @var $matches array */
 		foreach ($matches as $ma) {
 			if (!unlink($ma)) {
-				\OC_Log::write('Encryption library',
-					'Could not delete shareKey; does not exist: "' . $ma . '"', \OC_Log::ERROR);
+				\OCP\Util::writeLog('Encryption library',
+					'Could not delete shareKey; does not exist: "' . $ma . '"', \OCP\Util::ERROR);
 			}
 		}
 		$subdirs = $directories = glob(preg_quote($dir) . '/*', GLOB_ONLYDIR);
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 6d5b4fe5e3..5ccf0d94d3 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -268,8 +268,8 @@ class Proxy extends \OC_FileProxy {
 
 		// Delete keyfile & shareKey so it isn't orphaned
 		if (!Keymanager::deleteFileKey($view, $owner, $ownerPath)) {
-			\OC_Log::write('Encryption library',
-				'Keyfile or shareKey could not be deleted for file "' . $ownerPath . '"', \OC_Log::ERROR);
+			\OCP\Util::writeLog('Encryption library',
+				'Keyfile or shareKey could not be deleted for file "' . $ownerPath . '"', \OCP\Util::ERROR);
 		}
 
 		Keymanager::delAllShareKeys($view, $owner, $ownerPath);
-- 
GitLab