开发者 | Bob Jones |
---|---|
更新时间 | 2014年10月9日 23:32 |
捐献地址: | 去捐款 |
PHP版本: | 3.0.1 及以上 |
WordPress版本: | 3.9 |
版权: | GPLv2 or later |
版权网址: | 版权信息 |
/wp-content/plugins/
directoryThere are only three commonly used methods to debug code:
RHJ4Diagnostics::instance('enabled'=>true|false);
$diags->option(array ('level' => E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_STRICT);
$diags->option(array ('level' => 0);
$diags = RHJ4Diagnostics::instance(); $diags->diagnostic('Message # 1', 'FUNCTION A: '); ... $diags->diagnostic('Message # 2', 'FUNCTION B: '); ... $diags->diagnostic('Message # 3', 'FUNCTION C: ');
$diags->diagnostic('Message text', array('output'=> array( 'function' => 'my_diagnostic_test_output', 'logfile' => 'demo.log')));
Yes. The "threshold" option determines which messages will be displayed. If the current threshold value is 10 and the message's threshold value is greater than 10, the message will not be logged. If the message threshold is 10 or less, it will be logged. $diags = RHJ4Diagnostics::instance(); $diags->options(array('enabled' => true, 'threshold' => 6); $diags->diagnostic('This message will not be logged',array('threshold'=>7)); $diags->diagnostic('This message will be logged',array('threshold'=>5));
Yes. On the first page establish your settings like this: $diags = RHJ4Diagnostics::instance(); $diags->set(array('enabled' => true, 'threshold' => 6);