Just another url shortener http://shikiryu.alwaysdata.net/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

29 lines
715 B

<?
class Log {
protected $logfile;
function __construct($filename) {
$file = $filename;
$this->logfile = fopen($file, 'a+');
$this->message('Starting log');
}
function message($message) {
$message = '['. date("Y-m-d / H:i:s") . '] @MESSAGE'.' - '.$message;
$message .= "\n";
return fwrite( $this->logfile, $message );
}
function error($message) {
$message = '['. date("Y-m-d / H:i:s") . '] @ERROR'.' - '.$message;
$message .= "\n";
return fwrite( $this->logfile, $message );
}
function __destruct(){
$this->message("Finishing log\n-----------------------");
return fclose( $this->logfile );
}
}