Sometime, it is easy to use Magento log to track the problem.However, it is hard to find the your desired information as the logfile is large with lots of other information. The better way is tocreate
a custom file to store your own debug info. It is easy asfollowing:
public static function logException(Exception$e)
{
if (!self::getConfig()) {
return;
}
$file = self::getStoreConfig('dev/log/exception_file');
self::log("\n" . $e->__toString(), Zend_Log::ERR,$file);
}
There are two methods in the phptemplate.engine.They arephptemplate_init and phptemplate_theme. phptemplate_init()implements hook_init() with argument $template.
The main task of phptemplate_init is to incude the template.phpfime so that functions defined in the template.php can be used atproper time and place.Everyone like will have one doubt about theparameter $template. Where does it come from and what is its datastructure?When the drupal boots, it initialize drupal theme usingdrupal_theme_initialize(). In method drupal_theme_initialize()method, it will list all of themes in the drupal and call themeengine init fuction with theme files parameter.
The following code snippets as proof:
if(function_exists($theme_engine.'_init')){
call_user_func($theme_engine.'_init',$theme);
}
There are two methods in the phptemplate.engine.They arephptemplate_init and phptemplate_theme. phptemplate_init()implements hook_init() with argument $template.
The main task of phptemplate_init is to incude the template.phpfime so that functions defined in the template.php can be used atproper time and place.Everyone like will have one doubt about theparameter $template. Where does it come from and what is its datastructure?When the drupal boots, it initialize drupal theme usingdrupal_theme_initialize(). In method drupal_theme_initialize()method, it will list all of themes in the drupal and call themeengine init fuction with theme files parameter.
The following code snippets as proof:
if(function_exists($theme_engine.'_init')){
call_user_func($theme_engine.'_init',$theme);
}
本文介绍了一种通过创建自定义日志文件来高效存储和跟踪调试信息的方法,该方法使用PHP函数实现,简化了从大量日志中提取所需信息的过程。
512

被折叠的 条评论
为什么被折叠?



