<?php
class Log {
	private $filename;

	public function __construct($filename) {
		$this->filename = $filename;
	}

	public function write($message) {
		$file = DIR_LOGS . date('Y-m-d').'_'.$this->filename;

		$handle = fopen($file, 'a+');
		$date = new DateTime();
		
		fwrite($handle, $date->format('Y-m-d G:i:s.v') .  ' - ' . $message . "\n");

		fclose($handle);
	}
}
