Skip to content

Commit

Permalink
Only use the syslog priority value for syslog().
Browse files Browse the repository at this point in the history
The rest of the Log package expects PEAR_LOG_* constants.

This closes pear#1.
  • Loading branch information
jparise committed Nov 16, 2011
1 parent 5f33eb9 commit 6a496e8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
6 changes: 3 additions & 3 deletions Log/syslog.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,9 +173,9 @@ function log($message, $priority = null)
$message = $this->_extractMessage($message);

/* Build a syslog priority value based on our current configuration. */
$priority = $this->_toSyslog($priority);
$syslogPriority = $this->_toSyslog($priority);
if ($this->_inherit) {
$priority |= $this->_name;
$syslogPriority |= $this->_name;
}

/* Apply the configured line format to the message string. */
Expand All @@ -190,7 +190,7 @@ function log($message, $priority = null)
}

foreach ($parts as $part) {
if (!syslog($priority, $part)) {
if (!syslog($syslogPriority, $part)) {
return false;
}
}
Expand Down
5 changes: 2 additions & 3 deletions package.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@
The Log package provides an abstracted logging framework. It includes output handlers for log files, databases, syslog, email, Firebug, and the console. It also provides composite and subject-observer logging mechanisms.
EOT;

$version = '1.12.7';
$version = '1.12.8';
$notes = <<<EOT
- The 'firebug' handler is now usable with Chrome, as well. (Request 18617)
- The 'observer' code now longer generates deprecated return value reference notices. (Bug 18830)
- The syslog handler now emits PEAR_LOG_* priorities. (pear/Log#1)
EOT;

$package = new PEAR_PackageFileManager2();
Expand Down
9 changes: 4 additions & 5 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
<email>jan@horde.org</email>
<active>yes</active>
</lead>
<date>2011-09-18</date>
<time>17:50:51</time>
<date>2011-11-15</date>
<time>00:00:00</time>
<version>
<release>1.12.7</release>
<release>1.12.8</release>
<api>1.0.0</api>
</version>
<stability>
Expand All @@ -37,8 +37,7 @@
</stability>
<license uri="http://www.opensource.org/licenses/mit-license.php">MIT License</license>
<notes>
- The &apos;firebug&apos; handler is now usable with Chrome, as well. (Request 18617)
- The &apos;observer&apos; code now longer generates deprecated return value reference notices. (Bug 18830)
- The syslog handler now emits PEAR_LOG_* priorities. (pear/Log#1)
</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down

0 comments on commit 6a496e8

Please sign in to comment.