Revision 1349,
727 bytes
checked in by niltonneto, 15 years ago
(diff) |
Ticket #561 - Inclusão do módulo Workflow faltante nessa versão.
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[1349] | 1 | --TEST-- |
---|
| 2 | Log: Priorities |
---|
| 3 | --FILE-- |
---|
| 4 | <?php |
---|
| 5 | |
---|
| 6 | require_once 'Log.php'; |
---|
| 7 | |
---|
| 8 | $conf = array('lineFormat' => '[%3$s] %4$s'); |
---|
| 9 | $logger = &Log::singleton('console', '', 'ident', $conf); |
---|
| 10 | |
---|
| 11 | /* Log at the default PEAR_LOG_INFO level. */ |
---|
| 12 | $logger->log('Log message'); |
---|
| 13 | |
---|
| 14 | /* Set the default priority to PEAR_LOG_DEBUG. */ |
---|
| 15 | $logger->setPriority(PEAR_LOG_DEBUG); |
---|
| 16 | $logger->log('Log message'); |
---|
| 17 | |
---|
| 18 | /* Verify that the getPriority() method also things we're at PEAR_LOG_DEBUG. */ |
---|
| 19 | $priority = $logger->priorityToString($logger->getPriority()); |
---|
| 20 | echo "$priority\n"; |
---|
| 21 | |
---|
| 22 | /* Verify that stringToPriority() can convert back to a constant. */ |
---|
| 23 | $priority = $logger->stringToPriority($priority); |
---|
| 24 | echo "$priority\n"; |
---|
| 25 | |
---|
| 26 | --EXPECT-- |
---|
| 27 | [info] Log message |
---|
| 28 | [debug] Log message |
---|
| 29 | debug |
---|
| 30 | 7 |
---|
Note: See
TracBrowser
for help on using the repository browser.