--- nfo/php/libs/net.php.pear/Log/file.php 2003/02/05 21:48:31 1.2 +++ nfo/php/libs/net.php.pear/Log/file.php 2003/02/05 22:06:42 1.3 @@ -33,7 +33,7 @@ // | Jon Parise | // +-----------------------------------------------------------------------+ // -// $Id: file.php,v 1.2 2003/02/05 21:48:31 joko Exp $ +// $Id: file.php,v 1.3 2003/02/05 22:06:42 joko Exp $ /** * The Log_file class is a concrete implementation of the Log:: @@ -41,7 +41,7 @@ * on the previous Log_file class by Jon Parise. * * @author Richard Heyes -* @version $Revision: 1.2 $ +* @version $Revision: 1.3 $ * @package Log */ class Log_file extends Log @@ -116,6 +116,13 @@ $this->_logLines = array(); $this->_writeOut = true; + $this->_timestampFormat = '%b %d %H:%M:%S'; + + /* If a timestamp format has been provided, use it. */ + if (!empty($conf['timestampFormat'])) { + $this->_timestampFormat = $conf['timestampFormat']; + } + $this->PEAR(); } @@ -159,7 +166,7 @@ } // Add to loglines array - $this->_logLines[] = array('message' => $message, 'priority' => $priority, 'time' => strftime('%b %d %H:%M:%S')); + $this->_logLines[] = array('message' => $message, 'priority' => $priority, 'time' => strftime($this->_timestampFormat)); // Notify observers $this->notifyAll(array('message' => $message, 'priority' => $priority));