* @author Chuck Hagenbuch <chuck@horde.org>
* @license http://opensource.org/licenses/bsd-license.php BSD
*/
-class Horde_Log_Formatter_Xml
+class Horde_Log_Formatter_Xml implements Horde_Log_Formatter_Interface
{
protected $_options = array('elementEntry' => 'log',
'elementTimestamp' => 'timestamp',
/**
* Class Constructor
*
- * @param mixed $streamOrUrl Stream or URL to open as a stream
- * @param string $mode Mode, only applicable if a URL is given
- * @param Horde_Log_Formatter_Interface $formatter Log formatter
+ * @param mixed $streamOrUrl Stream or URL to open
+ * as a stream.
+ * @param string $mode Mode, only applicable
+ * if a URL is given.
+ * @param Horde_Log_Formatter_Interface $formatter Log formatter.
*/
- public function __construct($streamOrUrl, $mode = 'a+', $formatter = null)
+ public function __construct($streamOrUrl, $mode = 'a+',
+ Horde_Log_Formatter_Interface $formatter = null)
{
if (is_null($formatter)) {
$formatter = new Horde_Log_Formatter_Simple();
*/
public function __wakeup()
{
- if (! $this->_stream = @fopen($this->_streamOrUrl, $this->_mode, false)) {
+ if (!($this->_stream = @fopen($this->_streamOrUrl, $this->_mode, false))) {
$msg = '"' . $this->_streamOrUrl . '" cannot be opened with mode "' . $this->_mode . '"';
throw new Horde_Log_Exception($msg);
}
{
$line = $this->_formatter->format($event);
- if (! @fwrite($this->_stream, $line)) {
+ if (!@fwrite($this->_stream, $line)) {
throw new Horde_Log_Exception("Unable to write to stream");
}