<?

define ('LOG_FILE_PATH','log.txt');

class Logger extends Object{
     function constructor() {
        parent::constructor();
#        $this->write('Logger started.', true);
     }

     function write($str, $clean = false) {
       $fp = fopen (LOG_FILE_PATH, $clean ? "w" : "a");

       if ($fp) {
       	fwrite($fp,date ("d.m.y H:i:s").": ".rtrim($str,"\n")."\n");
       }
       fclose($fp);
     }
}

?>