Go to the documentation of this file.00001 <?php
00016 class axTextLogger extends axLogger {
00017
00022 protected $_file;
00023
00040 public $format;
00041
00053 public function __construct ($filename, $mask = false, $format = false, $open_mode = 'a') {
00054 parent::__construct($mask);
00055 try {
00056 $this->_file = new SplFileObject($filename, $open_mode);
00057 }
00058 catch (RuntimeException $e) {
00059 return;
00060 }
00061 $this->format = $format === false ? "[%s] %s: %s\n" : $format;
00062 }
00063
00067 public function writeMessage ($msg, $severity) {
00068 $this->_file->fwrite(sprintf($this->format, date('r'), $severity, $msg));
00069 }
00070 }