<?php
Class Log { 
    public static function write($msg,$data="") 
    { 
		//return ;
		$date = date('Y-m-d H:i:s'); 
		$file = "Err_" . date('Ymd') . ".log" ;
		if ($data != "") {
			error_log("[" . $date . "] " . $data . "\n", 3, PATH_LOG . $file) ;
		}
		if(is_array($msg)){
			error_log("[" . $date . "] " . print_r($msg,true) . "\n", 3, PATH_LOG . $file); 
		}else if(is_object($msg)){
			error_log("[" . $date . "] " . print_r($msg,true) . "\n", 3, PATH_LOG . $file); 
		}else{
			error_log("[" . $date . "] " . $msg . "\n", 3, PATH_LOG . $file); 
		}
    } 
} 

Class DebugLog { 
    public static function write($msg,$data="") 
    { 
		//return ;
		$date = date('Y-m-d H:i:s'); 
		$file = "Debug_" . date('Ymd') . ".log" ;
		if ($data != "") {
			error_log("[" . $date . "] " . $data . "\n", 3, PATH_LOG . $file) ;
		}
		error_log("[" . $date . "] " . $msg . "\n", 3, PATH_LOG . $file); 
    } 
} 

Class EmailLog{
    public static function write($msg,$data="") 
    { 
		//return ;
		$date = date('Y-m-d H:i:s'); 
		$file = "EmailLog_" . date('Ymd') . ".log" ;
		if ($data != "") {
			error_log("[" . $date . "] " . $data . "\n", 3, PATH_LOG . $file) ;
		}
		error_log("[" . $date . "] " . $msg . "\n", 3, PATH_LOG . $file); 
    } 
	
}

Class ForeignKeyLog{
    public static function write($msg,$data="") 
    { 
		//return ;
		$date = date('Y-m-d H:i:s'); 
		$file = "ForeignKeyLog_" . date('Ymd') . ".log" ;
		if ($data != "") {
			error_log("[" . $date . "] " . $data . "\n", 3, PATH_LOG . $file) ;
		}
		error_log("[" . $date . "] " . $msg . "\n", 3, PATH_LOG . $file); 
    } 
	
}

?>