aboutsummaryrefslogtreecommitdiff
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
parentaa8529b2d617137cc7500742090e5bb2246b8928 (diff)
Replace Minz_Log::record by corresponding methods
Please not use Minz_Log::record anymore! See https://github.com/marienfressinaud/FreshRSS/issues/655
-rwxr-xr-xapp/Controllers/entryController.php2
-rwxr-xr-xapp/Controllers/feedController.php14
-rwxr-xr-xapp/Controllers/indexController.php20
-rwxr-xr-xapp/Controllers/javascriptController.php2
-rw-r--r--app/FreshRSS.php2
-rw-r--r--app/Models/CategoryDAO.php6
-rw-r--r--app/Models/EntryDAO.php30
-rw-r--r--app/Models/EntryDAOSQLite.php14
-rw-r--r--app/Models/FeedDAO.php20
-rw-r--r--app/Models/FeedDAOSQLite.php2
-rw-r--r--app/Models/UserDAO.php4
-rw-r--r--app/views/index/index.phtml2
-rw-r--r--lib/Minz/FrontController.php4
-rw-r--r--lib/Minz/View.php12
-rw-r--r--p/api/greader.php6
-rwxr-xr-xp/i/index.php2
16 files changed, 68 insertions, 74 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
diff --git a/app/FreshRSS.php b/app/FreshRSS.php
index 61e8d83f0..efd302ecc 100644
--- a/app/FreshRSS.php
+++ b/app/FreshRSS.php
@@ -101,7 +101,7 @@ class FreshRSS extends Minz_FrontController {
'content' => 'Invalid configuration for user [' . $currentUser . ']!',
);
Minz_Session::_param('notification', $notif);
- Minz_Log::record($notif['content'] . ' ' . $me->getMessage(), Minz_Log::WARNING);
+ Minz_Log::warning($notif['content'] . ' ' . $me->getMessage());
Minz_Session::_param('currentUser', '');
} catch (Exception $e) {
die($e->getMessage());
diff --git a/app/Models/CategoryDAO.php b/app/Models/CategoryDAO.php
index ce1babfdd..2e333d2f1 100644
--- a/app/Models/CategoryDAO.php
+++ b/app/Models/CategoryDAO.php
@@ -13,7 +13,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo {
return $this->bd->lastInsertId();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error addCategory: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error addCategory: ' . $info[2] );
return false;
}
}
@@ -44,7 +44,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateCategory: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateCategory: ' . $info[2]);
return false;
}
}
@@ -59,7 +59,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error deleteCategory: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error deleteCategory: ' . $info[2]);
return false;
}
}
diff --git a/app/Models/EntryDAO.php b/app/Models/EntryDAO.php
index 34717123c..5a136499a 100644
--- a/app/Models/EntryDAO.php
+++ b/app/Models/EntryDAO.php
@@ -40,11 +40,11 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
if ((int)($info[0] / 1000) !== 23) { //Filter out "SQLSTATE Class code 23: Constraint Violation" because of expected duplicate entries
- Minz_Log::record('SQL error addEntry: ' . $info[0] . ': ' . $info[1] . ' ' . $info[2]
- . ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title'], Minz_Log::ERROR);
+ Minz_Log::error('SQL error addEntry: ' . $info[0] . ': ' . $info[1] . ' ' . $info[2]
+ . ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title']);
} /*else {
- Minz_Log::record ('SQL error ' . $info[0] . ': ' . $info[1] . ' ' . $info[2]
- . ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title'], Minz_Log::DEBUG);
+ Minz_Log::debug('SQL error ' . $info[0] . ': ' . $info[1] . ' ' . $info[2]
+ . ' while adding entry in feed ' . $valuesTmp['id_feed'] . ' with title: ' . $valuesTmp['title']);
}*/
return false;
}
@@ -94,7 +94,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markFavorite: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markFavorite: ' . $info[2]);
return false;
}
}
@@ -124,7 +124,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
return true;
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateCacheUnreads: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateCacheUnreads: ' . $info[2]);
return false;
}
}
@@ -147,7 +147,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markRead: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markRead: ' . $info[2]);
return false;
}
$affected = $stm->rowCount();
@@ -166,7 +166,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markRead: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markRead: ' . $info[2]);
return false;
}
}
@@ -175,7 +175,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
public function markReadEntries($idMax = 0, $onlyFavorites = false, $priorityMin = 0) {
if ($idMax == 0) {
$idMax = time() . '000000';
- Minz_Log::record('Calling markReadEntries(0) is deprecated!', Minz_Log::DEBUG);
+ Minz_Log::debug('Calling markReadEntries(0) is deprecated!');
}
$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id '
@@ -190,7 +190,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadEntries: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markReadEntries: ' . $info[2]);
return false;
}
$affected = $stm->rowCount();
@@ -203,7 +203,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
public function markReadCat($id, $idMax = 0) {
if ($idMax == 0) {
$idMax = time() . '000000';
- Minz_Log::record('Calling markReadCat(0) is deprecated!', Minz_Log::DEBUG);
+ Minz_Log::debug('Calling markReadCat(0) is deprecated!');
}
$sql = 'UPDATE `' . $this->prefix . 'entry` e INNER JOIN `' . $this->prefix . 'feed` f ON e.id_feed=f.id '
@@ -213,7 +213,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadCat: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markReadCat: ' . $info[2]);
return false;
}
$affected = $stm->rowCount();
@@ -226,7 +226,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
public function markReadFeed($id, $idMax = 0) {
if ($idMax == 0) {
$idMax = time() . '000000';
- Minz_Log::record('Calling markReadFeed(0) is deprecated!', Minz_Log::DEBUG);
+ Minz_Log::debug('Calling markReadFeed(0) is deprecated!');
}
$this->bd->beginTransaction();
@@ -237,7 +237,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadFeed: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markReadFeed: ' . $info[2]);
$this->bd->rollBack();
return false;
}
@@ -251,7 +251,7 @@ class FreshRSS_EntryDAO extends Minz_ModelPdo {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadFeed: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markReadFeed: ' . $info[2]);
$this->bd->rollBack();
return false;
}
diff --git a/app/Models/EntryDAOSQLite.php b/app/Models/EntryDAOSQLite.php
index 9dc395c3c..66078aca9 100644
--- a/app/Models/EntryDAOSQLite.php
+++ b/app/Models/EntryDAOSQLite.php
@@ -26,7 +26,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
return true;
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateCacheUnreads: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateCacheUnreads: ' . $info[2]);
return false;
}
}
@@ -47,7 +47,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markRead 1: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markRead 1: ' . $info[2]);
$this->bd->rollBack();
return false;
}
@@ -59,7 +59,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markRead 2: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markRead 2: ' . $info[2]);
$this->bd->rollBack();
return false;
}
@@ -72,7 +72,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
public function markReadEntries($idMax = 0, $onlyFavorites = false, $priorityMin = 0) {
if ($idMax == 0) {
$idMax = time() . '000000';
- Minz_Log::record('Calling markReadEntries(0) is deprecated!', Minz_Log::DEBUG);
+ Minz_Log::debug('Calling markReadEntries(0) is deprecated!');
}
$sql = 'UPDATE `' . $this->prefix . 'entry` SET is_read=1 WHERE is_read=0 AND id <= ?';
@@ -85,7 +85,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadEntries: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markReadEntries: ' . $info[2]);
return false;
}
$affected = $stm->rowCount();
@@ -98,7 +98,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
public function markReadCat($id, $idMax = 0) {
if ($idMax == 0) {
$idMax = time() . '000000';
- Minz_Log::record('Calling markReadCat(0) is deprecated!', Minz_Log::DEBUG);
+ Minz_Log::debug('Calling markReadCat(0) is deprecated!');
}
$sql = 'UPDATE `' . $this->prefix . 'entry` '
@@ -109,7 +109,7 @@ class FreshRSS_EntryDAOSQLite extends FreshRSS_EntryDAO {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error markReadCat: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error markReadCat: ' . $info[2]);
return false;
}
$affected = $stm->rowCount();
diff --git a/app/Models/FeedDAO.php b/app/Models/FeedDAO.php
index b89ae2045..852de6e36 100644
--- a/app/Models/FeedDAO.php
+++ b/app/Models/FeedDAO.php
@@ -19,7 +19,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $this->bd->lastInsertId();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error addFeed: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error addFeed: ' . $info[2]);
return false;
}
}
@@ -77,7 +77,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateFeed: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateFeed: ' . $info[2]);
return false;
}
}
@@ -107,7 +107,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateLastUpdate: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateLastUpdate: ' . $info[2]);
return false;
}
}
@@ -131,7 +131,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error changeCategory: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error changeCategory: ' . $info[2]);
return false;
}
}
@@ -146,7 +146,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error deleteFeed: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error deleteFeed: ' . $info[2]);
return false;
}
}
@@ -160,7 +160,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error deleteFeedByCategory: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error deleteFeedByCategory: ' . $info[2]);
return false;
}
}
@@ -289,7 +289,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateCachedValues: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateCachedValues: ' . $info[2]);
return false;
}
}
@@ -301,7 +301,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
$this->bd->beginTransaction();
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error truncate: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error truncate: ' . $info[2]);
$this->bd->rollBack();
return false;
}
@@ -313,7 +313,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
$stm = $this->bd->prepare($sql);
if (!($stm && $stm->execute($values))) {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error truncate: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error truncate: ' . $info[2]);
$this->bd->rollBack();
return false;
}
@@ -338,7 +338,7 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error cleanOldEntries: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error cleanOldEntries: ' . $info[2]);
return false;
}
}
diff --git a/app/Models/FeedDAOSQLite.php b/app/Models/FeedDAOSQLite.php
index 0d1872389..7599fda53 100644
--- a/app/Models/FeedDAOSQLite.php
+++ b/app/Models/FeedDAOSQLite.php
@@ -11,7 +11,7 @@ class FreshRSS_FeedDAOSQLite extends FreshRSS_FeedDAO {
return $stm->rowCount();
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record('SQL error updateCachedValues: ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error updateCachedValues: ' . $info[2]);
return false;
}
}
diff --git a/app/Models/UserDAO.php b/app/Models/UserDAO.php
index 0c96d7175..15215258c 100644
--- a/app/Models/UserDAO.php
+++ b/app/Models/UserDAO.php
@@ -28,7 +28,7 @@ class FreshRSS_UserDAO extends Minz_ModelPdo {
return true;
} else {
$info = empty($stm) ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error : ' . $info[2]);
return false;
}
}
@@ -48,7 +48,7 @@ class FreshRSS_UserDAO extends Minz_ModelPdo {
return true;
} else {
$info = $stm == null ? array(2 => 'syntax error') : $stm->errorInfo();
- Minz_Log::record ('SQL error : ' . $info[2], Minz_Log::ERROR);
+ Minz_Log::error('SQL error : ' . $info[2]);
return false;
}
}
diff --git a/app/views/index/index.phtml b/app/views/index/index.phtml
index 5e935b81e..584792e29 100644
--- a/app/views/index/index.phtml
+++ b/app/views/index/index.phtml
@@ -21,5 +21,5 @@ if ($this->loginOk || Minz_Configuration::allowAnonymous()) {
$this->renderHelper('view/rss_view');
} else {
// Normally, it should not happen, but log it anyway
- Minz_Log::record('Something is wrong in ' . __FILE__ . ' line ' . __LINE__, Minz_Log::ERROR);
+ Minz_Log::error('Something is wrong in ' . __FILE__ . ' line ' . __LINE__);
}
diff --git a/lib/Minz/FrontController.php b/lib/Minz/FrontController.php
index f13882801..e95c56bf3 100644
--- a/lib/Minz/FrontController.php
+++ b/lib/Minz/FrontController.php
@@ -46,7 +46,7 @@ class Minz_FrontController {
);
Minz_Request::forward ($url);
} catch (Minz_Exception $e) {
- Minz_Log::record ($e->getMessage (), Minz_Log::ERROR);
+ Minz_Log::error($e->getMessage());
$this->killApp ($e->getMessage ());
}
@@ -85,7 +85,7 @@ class Minz_FrontController {
$this->dispatcher->run();
} catch (Minz_Exception $e) {
try {
- Minz_Log::record ($e->getMessage (), Minz_Log::ERROR);
+ Minz_Log::error($e->getMessage());
} catch (Minz_PermissionDeniedException $e) {
$this->killApp ($e->getMessage ());
}
diff --git a/lib/Minz/View.php b/lib/Minz/View.php
index a0dec1824..b40448491 100644
--- a/lib/Minz/View.php
+++ b/lib/Minz/View.php
@@ -71,9 +71,7 @@ class Minz_View {
*/
public function render () {
if ((include($this->view_filename)) === false) {
- Minz_Log::record ('File not found: `'
- . $this->view_filename . '`',
- Minz_Log::NOTICE);
+ Minz_Log::notice('File not found: `' . $this->view_filename . '`');
}
}
@@ -87,9 +85,7 @@ class Minz_View {
. $part . '.phtml';
if ((include($fic_partial)) === false) {
- Minz_Log::record ('File not found: `'
- . $fic_partial . '`',
- Minz_Log::WARNING);
+ Minz_Log::warning('File not found: `' . $fic_partial . '`');
}
}
@@ -103,9 +99,7 @@ class Minz_View {
. $helper . '.phtml';
if ((include($fic_helper)) === false) {;
- Minz_Log::record ('File not found: `'
- . $fic_helper . '`',
- Minz_Log::WARNING);
+ Minz_Log::warning('File not found: `' . $fic_helper . '`');
}
}
diff --git a/p/api/greader.php b/p/api/greader.php
index 5a6fdad7d..1a66c30fb 100644
--- a/p/api/greader.php
+++ b/p/api/greader.php
@@ -160,7 +160,7 @@ function authorizationToUserConf() {
return $conf;
} else {
logMe('Invalid API authorisation for user ' . $user . ': ' . $headerAuthX[1] . "\n");
- Minz_Log::record('Invalid API authorisation for user ' . $user . ': ' . $headerAuthX[1], Minz_Log::WARNING);
+ Minz_Log::warning('Invalid API authorisation for user ' . $user . ': ' . $headerAuthX[1]);
unauthorized();
}
} else {
@@ -181,7 +181,7 @@ function clientLogin($email, $pass) { //http://web.archive.org/web/2013060409104
$conf = new FreshRSS_Configuration($email);
} catch (Exception $e) {
logMe($e->getMessage() . "\n");
- Minz_Log::record('Invalid API user ' . $email, Minz_Log::WARNING);
+ Minz_Log::warning('Invalid API user ' . $email);
unauthorized();
}
if ($conf->apiPasswordHash != '' && password_verify($pass, $conf->apiPasswordHash)) {
@@ -191,7 +191,7 @@ function clientLogin($email, $pass) { //http://web.archive.org/web/2013060409104
'Auth=', $auth, "\n";
exit();
} else {
- Minz_Log::record('Password API mismatch for user ' . $email, Minz_Log::WARNING);
+ Minz_Log::warning('Password API mismatch for user ' . $email);
unauthorized();
}
} else {
diff --git a/p/i/index.php b/p/i/index.php
index 7b34eefd1..ec969c159 100755
--- a/p/i/index.php
+++ b/p/i/index.php
@@ -46,7 +46,7 @@ if (file_exists(DATA_PATH . '/do-install.txt')) {
$front_controller->run();
} catch (Exception $e) {
echo '### Fatal error! ###<br />', "\n";
- Minz_Log::record($e->getMessage(), Minz_Log::ERROR);
+ Minz_Log::error($e->getMessage());
echo 'See logs files.';
}
}