slabphp/debug

SlabPHP Debug 库

v0.1.0 2018-02-20 00:00 UTC

This package is auto-updated.

Last update: 2024-09-22 05:31:33 UTC


README

该调试库为收集信息添加了一个简单的接口,以便将其包含在 SlabPHP 调试工具栏中。

用法

包含此项目

composer require slabphp/debug

基准测试

您可以使用以下方法开始和结束基准测试:

$debug = new \Slab\Debug\Manager();

$debug->startBenchmark('starting up');

// do some stuff

$debug->endBenchmark('starting up');

当您执行 ->getBenchmarks() 时,基准测试的结果将被返回。

消息

您可以使用以下方法添加调试消息:

$debug->addMessage("Something happened!", "CONTROLLER");

当您执行 ->getMessages() 时,一个条目将出现在“控制器”上下文中,并带有时间戳。