Home » Logging » Log » Bug #2853
Request for Log::stringToPriority
Details
| Request #2853 | Request for Log::stringToPriority |
|---|---|
| Submitted | 2004-11-29 15:31 UTC |
| From | andrew dot libby at perfectorder dot com |
| Assigned | jon |
| Status | Closed |
| Package | Log |
| PHP Version | 5.0.1 |
| OS | Any |
| 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.