PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Logging » Log » Bug #2853

Request for Log::stringToPriority

Details

Request #2853Request for Log::stringToPriority
Submitted2004-11-29 15:31 UTC
Fromandrew dot libby at perfectorder dot com
Assignedjon
StatusClosed
PackageLog
PHP Version5.0.1
OSAny
Roadmaps(Not assigned)

Comments

[2004-11-29 15:31 UTC] andrew dot libby at perfectorder dot com

Description:
------------
It's attractive to have a stringToPriority() method added to
the PEAR Log class to compliment the priorityToString()
method.

An example method might look like:

function stringToPriority($str)
{

$levels = array(
'emergencey' => PEAR_LOG_EMERG,
'alert' => PEAR_LOG_ALERT,
'critical' => PEAR_LOG_CRIT,
'error' => PEAR_LOG_ERR,
'warning' => PEAR_LOG_WARNING,
'notice' => PEAR_LOG_NOTICE,
'info' => PEAR_LOG_INFO,
'debug' => PEAR_LOG_DEBUG
);

return $levels[$str];
}

We're making pretty heavy use of this code, so if you're
in need of maintenance help, I'm certianly willing to help
with bugs and scuch as they come up.