Revision 795,
768 bytes
checked in by viani, 15 years ago
(diff) |
Ticket #488 - Inclusão do módulo workflow no ramo trunk do repositório Expresso.
|
-
Property svn:executable set to
*
|
Rev | Line | |
---|
[795] | 1 | <?php |
---|
| 2 | |
---|
| 3 | require_once 'Log.php'; |
---|
| 4 | |
---|
| 5 | function errorHandler($code, $message, $file, $line) |
---|
| 6 | { |
---|
| 7 | global $logger; |
---|
| 8 | |
---|
| 9 | /* Map the PHP error to a Log priority. */ |
---|
| 10 | switch ($code) { |
---|
| 11 | case E_WARNING: |
---|
| 12 | case E_USER_WARNING: |
---|
| 13 | $priority = PEAR_LOG_WARNING; |
---|
| 14 | break; |
---|
| 15 | case E_NOTICE: |
---|
| 16 | case E_USER_NOTICE: |
---|
| 17 | $priority = PEAR_LOG_NOTICE; |
---|
| 18 | break; |
---|
| 19 | case E_ERROR: |
---|
| 20 | case E_USER_ERROR: |
---|
| 21 | $priority = PEAR_LOG_ERR; |
---|
| 22 | break; |
---|
| 23 | default: |
---|
| 24 | $priotity = PEAR_LOG_INFO; |
---|
| 25 | } |
---|
| 26 | |
---|
| 27 | $logger->log($message . ' in ' . $file . ' at line ' . $line, |
---|
| 28 | $priority); |
---|
| 29 | } |
---|
| 30 | |
---|
| 31 | $logger = &Log::singleton('console', '', 'ident'); |
---|
| 32 | |
---|
| 33 | set_error_handler('errorHandler'); |
---|
| 34 | trigger_error('This is an information log message.', E_USER_NOTICE); |
---|
Note: See
TracBrowser
for help on using the repository browser.