承接 rame0/chromephp 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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

  1. Install the browser extension from: https://chrome.google.com/extensions/detail/noaneddfkdjfnfdakjjmocngnfkfehhd
  2. Click the extension icon in the browser to enable it for the current tab's domain
  3. 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

1

Warning

$logger->warn('Some warning');
$logger->warn('Some other warning');

Result

2

Error

$logger->error('Some error');
$logger->error('Some other error');

Result

3

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

4

Exception

$ex = new InvalidArgumentException('Some exception!');
$logger->exception($ex);

try{
    new PDO('asdf');
}catch (PDOException $ex){
    $logger->exception($ex);
}

Result

5

More information can be found here: http://www.chromelogger.com

统计信息

  • 总下载量: 161
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 442
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2021-05-03