mirror of
https://github.com/Chouchen/svgToImage.git
synced 2020-02-03 22:08:42 +01:00
1st version, working for my project, will add more specification later
This commit is contained in:
29
log.php
Normal file
29
log.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?
|
||||
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 );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user