Parcourir la source

Replace Minz_Log::record by corresponding methods

Please not use Minz_Log::record anymore!

See https://github.com/marienfressinaud/FreshRSS/issues/655
Marien Fressinaud il y a 11 ans
Parent
commit
d8f4681382

+ 1 - 1
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());
 				}
 			}

+ 7 - 7
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);
 			}
 

+ 10 - 10
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()) {

+ 1 - 1
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

+ 1 - 1
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());

+ 3 - 3
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;
 		}
 	}

+ 15 - 15
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;
 			}

+ 7 - 7
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();

+ 10 - 10
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;
 		}
 	}

+ 1 - 1
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;
 		}
 	}

+ 2 - 2
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;
 			}
 		}

+ 1 - 1
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__);
 }

+ 2 - 2
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 ());
 			}

+ 3 - 9
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 . '`');
 		}
 	}
 

+ 3 - 3
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 {

+ 1 - 1
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.';
 	}
 }