public function __construct($level, $datecol = false, $levelcol = false, $messagecol = null, $logtable = null, $columns = null) { // TODO check $datecol exists // TODO check $levelcol exists // TODO check $logtable exists // TODO check $messagecol exists // TODO check all $columns exist $this->datecol = $datecol; $this->levelcol = $levelcol; $this->messagecol = $messagecol; $this->logtable = $logtable; $this->columns = $columns; parent::__construct($level, (bool) $datecol, (bool) $levelcol); }
public function __construct($level, $showdate = false, $showlevel = false, $fullpath = null) { if (empty($fullpath)) { throw new base_logger_exception('missing_fullpath_parameter', $fullpath); } if (!is_writable(dirname($fullpath))) { throw new base_logger_exception('file_not_writable', $fullpath); } // Open the OS file for writing (append) $this->fullpath = $fullpath; if ($level > backup::LOG_NONE) { // Only create the file if we are going to log something if (!($this->fhandle = fopen($this->fullpath, 'a'))) { throw new base_logger_exception('error_opening_file', $fullpath); } } parent::__construct($level, $showdate, $showlevel); }