aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-05 19:35:29 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-10-05 19:35:29 +0200
commitd8f4681382986524b91acb0500847e9f24badf20 (patch)
tree588741361a54d564bcce44e239157f38527fefe4 /app/Controllers
parentaa8529b2d617137cc7500742090e5bb2246b8928 (diff)
Replace Minz_Log::record by corresponding methods
Please not use Minz_Log::record anymore! See https://github.com/marienfressinaud/FreshRSS/issues/655
Diffstat (limited to 'app/Controllers')
-rwxr-xr-xapp/Controllers/entryController.php2
-rwxr-xr-xapp/Controllers/feedController.php14
-rwxr-xr-xapp/Controllers/indexController.php20
-rwxr-xr-xapp/Controllers/javascriptController.php2
4 files changed, 19 insertions, 19 deletions
diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php
index ec90666ed..d7be05663 100755
--- a/app/Controllers/entryController.php
+++ b/app/Controllers/entryController.php
@@ -143,7 +143,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
$nb = $feedDAO->cleanOldEntries($feed->id(), $date_min, $feedHistory);
if ($nb > 0) {
$nbTotal += $nb;
- Minz_Log::record($nb . ' old entries cleaned in feed [' . $feed->url() . ']', Minz_Log::DEBUG);
+ Minz_Log::debug($nb . ' old entries cleaned in feed [' . $feed->url() . ']');
//$feedDAO->updateLastUpdate($feed->id());
}
}
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index 93a8d7c2e..70d5c4e22 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -140,14 +140,14 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
}
}
} catch (FreshRSS_BadUrl_Exception $e) {
- Minz_Log::record($e->getMessage(), Minz_Log::WARNING);
+ Minz_Log::warning($e->getMessage());
$notif = array(
'type' => 'bad',
'content' => _t('invalid_url', $url)
);
Minz_Session::_param('notification', $notif);
} catch (FreshRSS_Feed_Exception $e) {
- Minz_Log::record($e->getMessage(), Minz_Log::WARNING);
+ Minz_Log::warning($e->getMessage());
$notif = array(
'type' => 'bad',
'content' => _t('internal_problem_feed',
@@ -156,7 +156,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
Minz_Session::_param('notification', $notif);
} catch (Minz_FileNotExistException $e) {
// Répertoire de cache n'existe pas
- Minz_Log::record($e->getMessage(), Minz_Log::ERROR);
+ Minz_Log::error($e->getMessage());
$notif = array(
'type' => 'bad',
'content' => _t('internal_problem_feed',
@@ -258,7 +258,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
$is_read = $this->view->conf->mark_when['reception'] ? 1 : 0;
foreach ($feeds as $feed) {
if (!$feed->lock()) {
- Minz_Log::record('Feed already being actualized: ' . $feed->url(), Minz_Log::NOTICE);
+ Minz_Log::notice('Feed already being actualized: ' . $feed->url());
continue;
}
try {
@@ -307,7 +307,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
}
$nb = $feedDAO->cleanOldEntries($feed->id(), $date_min, max($feedHistory, count($entries) + 10));
if ($nb > 0) {
- Minz_Log::record($nb . ' old entries cleaned in feed [' . $feed->url() . ']', Minz_Log::DEBUG);
+ Minz_Log::debug($nb . ' old entries cleaned in feed [' . $feed->url() . ']');
}
}
@@ -318,11 +318,11 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
}
$flux_update++;
if (($feed->url() !== $url)) { //HTTP 301 Moved Permanently
- Minz_Log::record('Feed ' . $url . ' moved permanently to ' . $feed->url(), Minz_Log::NOTICE);
+ Minz_Log::notice('Feed ' . $url . ' moved permanently to ' . $feed->url());
$feedDAO->updateFeed($feed->id(), array('url' => $feed->url()));
}
} catch (FreshRSS_Feed_Exception $e) {
- Minz_Log::record($e->getMessage(), Minz_Log::NOTICE);
+ Minz_Log::notice($e->getMessage());
$feedDAO->updateLastUpdate($feed->id(), 1);
}
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php
index 73638acb3..0d2eff700 100755
--- a/app/Controllers/indexController.php
+++ b/app/Controllers/indexController.php
@@ -59,7 +59,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
$getType = $get[0];
$getId = substr($get, 2);
if (!$this->checkAndProcessType($getType, $getId)) {
- Minz_Log::record('Not found [' . $getType . '][' . $getId . ']', Minz_Log::DEBUG);
+ Minz_Log::debug('Not found [' . $getType . '][' . $getId . ']');
Minz_Error::error(
404,
array('error' => array(_t('page_not_found')))
@@ -122,12 +122,12 @@ class FreshRSS_index_Controller extends Minz_ActionController {
// Si on a récupéré aucun article "non lus"
// on essaye de récupérer tous les articles
if ($this->view->state === FreshRSS_Entry::STATE_NOT_READ && empty($entries) && ($state_param === null) && ($filter == '')) {
- Minz_Log::record('Conflicting information about nbNotRead!', Minz_Log::DEBUG);
+ Minz_Log::debug('Conflicting information about nbNotRead!');
$feedDAO = FreshRSS_Factory::createFeedDao();
try {
$feedDAO->updateCachedValues();
} catch (Exception $ex) {
- Minz_Log::record('Failed to automatically correct nbNotRead! ' + $ex->getMessage(), Minz_Log::NOTICE);
+ Minz_Log::notice('Failed to automatically correct nbNotRead! ' + $ex->getMessage());
}
$this->view->state = FreshRSS_Entry::STATE_ALL;
$entries = $entryDAO->listWhere($getType, $getId, $this->view->state, $order, $nb, $first, $filter);
@@ -143,7 +143,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
$this->view->entries = $entries;
} catch (FreshRSS_EntriesGetter_Exception $e) {
- Minz_Log::record($e->getMessage(), Minz_Log::NOTICE);
+ Minz_Log::notice($e->getMessage());
Minz_Error::error(
404,
array('error' => array(_t('page_not_found')))
@@ -281,7 +281,7 @@ class FreshRSS_index_Controller extends Minz_ActionController {
$res = array();
$res['status'] = 'failure';
$res['reason'] = $reason == '' ? _t('invalid_login') : $reason;
- Minz_Log::record('Persona: ' . $res['reason'], Minz_Log::WARNING);
+ Minz_Log::warning('Persona: ' . $res['reason']);
}
header('Content-Type: application/json; charset=UTF-8');
@@ -358,13 +358,13 @@ class FreshRSS_index_Controller extends Minz_ActionController {
self::deleteLongTermCookie();
}
} else {
- Minz_Log::record('Password mismatch for user ' . $username . ', nonce=' . $nonce . ', c=' . $c, Minz_Log::WARNING);
+ Minz_Log::warning('Password mismatch for user ' . $username . ', nonce=' . $nonce . ', c=' . $c);
}
} catch (Minz_Exception $me) {
- Minz_Log::record('Login failure: ' . $me->getMessage(), Minz_Log::WARNING);
+ Minz_Log::warning('Login failure: ' . $me->getMessage());
}
} else {
- Minz_Log::record('Invalid credential parameters: user=' . $username . ' challenge=' . $c . ' nonce=' . $nonce, Minz_Log::DEBUG);
+ Minz_Log::debug('Invalid credential parameters: user=' . $username . ' challenge=' . $c . ' nonce=' . $nonce);
}
if (!$ok) {
$notif = array(
@@ -395,10 +395,10 @@ class FreshRSS_index_Controller extends Minz_ActionController {
Minz_Session::_param('currentUser', $username);
Minz_Session::_param('passwordHash', $s);
} else {
- Minz_Log::record('Unsafe password mismatch for user ' . $username, Minz_Log::WARNING);
+ Minz_Log::warning('Unsafe password mismatch for user ' . $username);
}
} catch (Minz_Exception $me) {
- Minz_Log::record('Unsafe login failure: ' . $me->getMessage(), Minz_Log::WARNING);
+ Minz_Log::warning('Unsafe login failure: ' . $me->getMessage());
}
Minz_Request::forward(array('c' => 'index', 'a' => 'index'), true);
} elseif (!Minz_Configuration::canLogIn()) {
diff --git a/app/Controllers/javascriptController.php b/app/Controllers/javascriptController.php
index 2a0dbd3d9..14e6f36de 100755
--- a/app/Controllers/javascriptController.php
+++ b/app/Controllers/javascriptController.php
@@ -37,7 +37,7 @@ class FreshRSS_javascript_Controller extends Minz_ActionController {
return; //Success
}
} catch (Minz_Exception $me) {
- Minz_Log::record('Nonce failure: ' . $me->getMessage(), Minz_Log::WARNING);
+ Minz_Log::warning('Nonce failure: ' . $me->getMessage());
}
}
$this->view->nonce = ''; //Failure