rame0/chromephp
最新稳定版本:5.0.3-patch1
Composer 安装命令:
composer require rame0/chromephp
包简介
Log variables to the Chrome console (via Chrome Logger Google Chrome extension).
README 文档
README
ChromePhp is a PHP library for the Chrome Logger Google Chrome extension.
This library allows you to log data to the Chrome console.
Requirements
- PHP 7.4 or later
Installation
- Install the browser extension from: https://chrome.google.com/extensions/detail/noaneddfkdjfnfdakjjmocngnfkfehhd
- Click the extension icon in the browser to enable it for the current tab's domain
- Install ChromePhp
It's not recommended to use this library on production!
Install as dev dependency:
composer require --dev rame0/chromephp
Install as prod dependency:
composer require rame0/chromephp
Log some data
// First require autoload require __DIR__ . '/vendor/autoload.php'; $logger = new ChromePhp();
Log
$logger->log('Some log message'); $logger->log('Some other log message');
Result
Warning
$logger->warn('Some warning'); $logger->warn('Some other warning');
Result
Error
$logger->error('Some error'); $logger->error('Some other error');
Result
Table
$table = []; for ($i = 0; $i < 5; $i++) { $row = []; for ($c = 1; $c < 3; $c++) { $row['Col ' . $c] = $i; } $table[] = $row; } $logger->table($table);
Result
Exception
$ex = new InvalidArgumentException('Some exception!'); $logger->exception($ex); try{ new PDO('asdf'); }catch (PDOException $ex){ $logger->exception($ex); }
Result
More information can be found here: http://www.chromelogger.com
统计信息
- 总下载量: 161
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: Apache-2.0
- 更新时间: 2021-05-03




