Location: PHPKode > scripts > Scrubs > scrubs/Logger.php
<?php

/**
 * 
 *
 * @version $Id$
 * @copyright 2003 
 **/

class Logger {
	
	var $log = "";
	var $logFile = "";
	
	function Logger() {
		$timeStamp = "----- ".date("m.d.y H:i:s")." -----\n";
		$this->log .= $timeStamp;
		$this->logFile = dirname(dirname(__FILE__))."/scrubs.log";
	}
	
	function debug($message) {
		$debugMessage = "Debug: $message \n";
		$this->log .= $debugMessage;
	}
	
	function info($message) {
		$infoMessage = "Info: $message \n";
		$this->log .= $infoMessage;
	}
	
	function warn($message) {
		$warningMessage = "Warning: $message \n";
		$this->log .= $warningMessage;
	}
	
	function error($message) {
		$errorMessage = "Error: $message \n";
		$this->log .= $errorMessage;
	}
	
	function fatal($message) {
		$fatalMessage = "Fatal Error: $message \n";
		$this->log .= $fatalMessage;
	}
	
	function execute() {
		$fp = fopen($this->logFile, "a");
		flock($fp, LOCK_EX);
		fwrite($fp, "$this->log \n");
		flock($fp, LOCK_UN);
		fclose($fp);
	}
}

?>
Return current item: Scrubs