cvs: pear /Log Log.php package.php package.xml /Log/tests extract.phpt extract2.phpt

From: Date: Thu, 09 Sep 2004 02:42:23 +0000
Subject: cvs: pear /Log Log.php package.php package.xml /Log/tests extract.phpt extract2.phpt
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-23741@lists.php.net to get a copy of this message
jon Wed Sep 8 22:42:23 2004 EDT Modified files: /pear/Log Log.php package.php package.xml /pear/Log/tests extract.phpt extract2.phpt Log: The Log::_extractMessage() routine will now extract and use the value of an array's 'message' key if it exists. Submitted by: Laurent Laville http://cvs.php.net/diff.php/pear/Log/Log.php?r1=1.45&r2=1.46&ty=u Index: pear/Log/Log.php diff -u pear/Log/Log.php:1.45 pear/Log/Log.php:1.46 --- pear/Log/Log.php:1.45 Mon Jan 19 03:02:38 2004 +++ pear/Log/Log.php Wed Sep 8 22:42:22 2004 @@ -1,9 +1,9 @@ <?php /** - * $Header: /usr/repository/pear/Log/Log.php,v 1.45 2004/01/19 08:02:38 jon Exp $ + * $Header: /usr/repository/pear/Log/Log.php,v 1.46 2004/09/09 02:42:22 jon Exp $ * $Horde: horde/lib/Log.php,v 1.15 2000/06/29 23:39:45 jon Exp $ * - * @version $Revision: 1.45 $ + * @version $Revision: 1.46 $ * @package Log */ @@ -391,7 +391,11 @@ $message = print_r($message, true); } } else if (is_array($message)) { - $message = print_r($message, true); + if (isset($message['message'])) { + $message = $message['message']; + } else { + $message = print_r($message, true); + } } /* Otherwise, we assume the message is a string. */ http://cvs.php.net/diff.php/pear/Log/package.php?r1=1.20&r2=1.21&ty=u Index: pear/Log/package.php diff -u pear/Log/package.php:1.20 pear/Log/package.php:1.21 --- pear/Log/package.php:1.20 Wed Sep 8 19:35:53 2004 +++ pear/Log/package.php Wed Sep 8 22:42:22 2004 @@ -3,17 +3,13 @@ require_once 'PEAR/PackageFileManager.php'; require_once 'Console/Getopt.php'; -$version = '1.8.6'; +$version = '1.8.7'; $notes = <<<EOT -The maximum length of the 'sql' handler's 'ident' string is now configurable. - -Different instances of the 'win' handler can now address their own output windows. +The Log package now supports logging arrays with a 'message' key. EOT; $changelog = <<<EOT -The maximum length of the 'sql' handler's 'ident' string is now configurable via the 'identLimit' configuration parameter. (Bug 2137) - -Different instances of the 'win' handler can now address their own output windows. (Bug 2212) +The Log::_extractMessage() routine will now extract and use the value of an array's 'message' key if it exists. (Laurent Laville) EOT; $package = new PEAR_PackageFileManager(); http://cvs.php.net/diff.php/pear/Log/package.xml?r1=1.75&r2=1.76&ty=u Index: pear/Log/package.xml diff -u pear/Log/package.xml:1.75 pear/Log/package.xml:1.76 --- pear/Log/package.xml:1.75 Wed Sep 8 19:35:53 2004 +++ pear/Log/package.xml Wed Sep 8 22:42:23 2004 @@ -13,13 +13,11 @@ </maintainer> </maintainers> <release> - <version>1.8.6</version> + <version>1.8.7</version> <date>2004-09-08</date> <license>PHP License</license> <state>stable</state> - <notes>The maximum length of the 'sql' handler's 'ident' string is now configurable. - -Different instances of the 'win' handler can now address their own output windows.</notes> + <notes>The Log package now supports logging arrays with a 'message' key.</notes> <deps> <dep type="pkg" rel="has" optional="yes">DB</dep> <dep type="ext" rel="has" optional="yes">sqlite</dep> @@ -83,6 +81,13 @@ </filelist> </release> <changelog> + <release> + <version>1.8.7</version> + <date>2004-09-08</date> + <license>PHP License</license> + <state>stable</state> + <notes>The Log::_extractMessage() routine will now extract and use the value of an array's 'message' key if it exists. (Laurent Laville)</notes> + </release> <release> <version>1.8.6</version> <date>2004-09-08</date> http://cvs.php.net/diff.php/pear/Log/tests/extract.phpt?r1=1.2&r2=1.3&ty=u Index: pear/Log/tests/extract.phpt diff -u pear/Log/tests/extract.phpt:1.2 pear/Log/tests/extract.phpt:1.3 --- pear/Log/tests/extract.phpt:1.2 Tue Aug 10 02:29:21 2004 +++ pear/Log/tests/extract.phpt Wed Sep 8 22:42:23 2004 @@ -32,6 +32,9 @@ /* Logging an array. */ $logger->log(array(1, 2, 'three' => 3)); +/* Logging an array with a 'message' key. */ +$logger->log(array('message' => 'Message Key')); + --EXPECT-- ident [info] String ident [info] bareobject Object @@ -47,3 +50,5 @@ [1] => 2 [three] => 3 ) + +ident [info] Message Key http://cvs.php.net/diff.php/pear/Log/tests/extract2.phpt?r1=1.1&r2=1.2&ty=u Index: pear/Log/tests/extract2.phpt diff -u pear/Log/tests/extract2.phpt:1.1 pear/Log/tests/extract2.phpt:1.2 --- pear/Log/tests/extract2.phpt:1.1 Tue Aug 10 02:29:21 2004 +++ pear/Log/tests/extract2.phpt Wed Sep 8 22:42:23 2004 @@ -36,6 +36,9 @@ /* Logging an array. */ $logger->log(array(1, 2, 'three' => 3)); +/* Logging an array with a 'message' key. */ +$logger->log(array('message' => 'Message Key')); + --EXPECT-- ident [info] String ident [info] BareObject Object @@ -52,3 +55,5 @@ [1] => 2 [three] => 3 ) + +ident [info] Message Key

« previous php.pear.cvs (#23741) next »