[] thinkphp Integrated firephp

Source: Internet
Author: User
[] thinkphp integrated firephp hehe
TP debugging is really silly difficult to use, to output trace information, the condition is as follows: 1. App_debug and Show_page_trace are set to true,2. Action must have a view before you can play your own imagination. Finally, the firephp integrated into the, Ha ha, the method is as follows: [is to replace the thinkphp/lib/think/core/log.class.php] class firephp.class.php Copy to the Thinkphp/lib/think/core directory, modify the following method: [recommended to back up the original file Oh, this is only for testing use]static function record ($message, $level =self::err, $record =false) {if ($record | | | In_array ($level, C (' Log_record_level '))) {$now = date (self:: $f            Ormat);                    Self:: $log [] = "{$now} {$level}: {$message}\r\n";    Switch ($level) {case self::d ebug:firephp::getinstance (True)->trace ($message, $level);    Break    Case Self::info:firephp::getinstance (True)->log ($message, $level);    Break    Case Self::sql:firephp::getinstance (True)->info ($message, $level);    Break    Case Self::notice:case Self::warn:firephp::getinstance (True)->warn ($message, $level);    Break    Default:firephp::getinstance (True)->error ($message, $level);    Break }}} for the output of SQL, because Thinkphp/lib/think/db/db.class.php inside the 128th line to debug parameters written dead, it must be bound with C (' App_debug '), it is difficult to understand, here is modified to add a custom, do not conflict with the original. The code is as follows: if (C (' App_debug ') | | c (' log_record_sql ')) in the configuration file, the following options are available: ' Log_record ' =>true,//logging ' log_record_sql ' = >true,//logging ' log_record_level ' = = Array (' Emerg ', ' alert ', ' crit ', ' err ', ' warn ', ' notic ', ' info ', ' Debug ', ' SQL ' ),//Allow logging level logging level can be self-increment or decrease hehe
?
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.