[Vtigercrm-commits] [vtiger-commits] r5364 - /vtigercrm/branches/4.2/include/database/PearDatabase.php

vtigercrm-commits at vtiger.fosslabs.com vtigercrm-commits at vtiger.fosslabs.com
Tue Apr 25 15:52:12 EDT 2006


Author: allanbush
Date: Tue Apr 25 13:52:07 2006
New Revision: 5364

Log:
Cleaned up the logging levels.  Closes #35.

Modified:
    vtigercrm/branches/4.2/include/database/PearDatabase.php

Modified: vtigercrm/branches/4.2/include/database/PearDatabase.php
==============================================================================
--- vtigercrm/branches/4.2/include/database/PearDatabase.php (original)
+++ vtigercrm/branches/4.2/include/database/PearDatabase.php Tue Apr 25 13:52:07 2006
@@ -41,15 +41,14 @@
 	
 	function println($msg)
 	{
-		require_once('include/logging.php');
-		$log1 =& LoggerManager::getLogger('VT');
+		global $vtlog;
 		if(is_array($msg))
 		{
-			$log1->fatal("PearDatabse ->".print_r($msg,true));
+			$vtlog->logthis("PearDatabse ->".print_r($msg,true), 'info');
 		}
 		else
 		{
-			$log1->fatal("PearDatabase ->".$msg);
+			$vtlog->logthis("PearDatabase ->".$msg, 'info');
 		}
 		return $msg;
 	}
@@ -149,27 +148,16 @@
 	
 	function checkError($msg='', $dieOnError=false)
 	{
-		/*if($this->database->ErrorNo())
-		{
-			if($this->dieOnError || $dieOnError)
-			{
-         	 		$this->println("ADODB error ".$this->database->ErrorNo());	
-				die ($msg."ADODB error ".$this->database->ErrorNo());
-				
-			}else{
-				$this->log->error("MySQL error ".mysql_errno().": ".mysql_error());
-			}
-			return true;
-		}*/
-		
+		global $vtlog;
+
 		if($this->dieOnError || $dieOnError)
 		{
-         		$this->println("ADODB error ".$msg."->[".$this->database->ErrorNo()."]".$this->database->ErrorMsg());	
+         		$vtlog->logthis("ADODB error ".$msg."->[".$this->database->ErrorNo()."]".$this->database->ErrorMsg(), 'fatal');	
 			die ($msg."ADODB error ".$msg."->".$this->database->ErrorMsg());
 		}
 		else
 		{
-			$this->println("ADODB error ".$msg."->[".$this->database->ErrorNo()."]".$this->database->ErrorMsg());
+			$vtlog->logthis("ADODB error ".$msg."->[".$this->database->ErrorNo()."]".$this->database->ErrorMsg(), 'error');
 
 		}
 		return false;





More information about the vtigercrm-commits mailing list