一个个人觉得比较好用的PHP日志类,给大家分享一下

func = $func;
		$this->debug( "begin ~~~" );
	}

	function __destruct( ) {
		$this->debug( "end ..." );
	}

	function try_covert_to_string( &$input ) {
		if( is_object( $input ) || is_array( $input ) ) {
			$input = var_export( $input, true );
		}
	}

	//错误日志
	function error( $string ) {
		//if( klog::$level < 1 ) return;
		$this->try_covert_to_string( $string );
		klog::logging( "error [" . $this->func . "] " . $string );
	}

	//跟踪日志
	function trace( $string ) {
		//if( klog::$level < 2 ) return;
		$this->try_covert_to_string( $string );
		klog::logging( "trace [" . $this->func . "] " . $string );
	}

	//调试日志
	function debug( $string ) {
		//if( klog::$level < 3 ) return;
		$this->try_covert_to_string( $string );
		klog::logging( "debug [" . $this->func . "] " . $string );
	}
}

?>
看注释差不多就行了 没什么好说的了

你可能感兴趣的:(一个个人觉得比较好用的PHP日志类,给大家分享一下)