定制 srt4rulez/monolog-tracy-bar-dump-handler 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

srt4rulez/monolog-tracy-bar-dump-handler

最新稳定版本:v1.0.0

Composer 安装命令:

composer require srt4rulez/monolog-tracy-bar-dump-handler

包简介

Monolog handler that logs to Tracy's barDump method.

README 文档

README

Latest Stable Version Packagist PHP Version Support License

Monolog handler that logs to Tracy's barDump method.

Getting Started

Install via composer:

composer require srt4rulez/monolog-tracy-bar-dump-handler

Then, add the handler to your monolog logger:

<?php

use Monolog\Logger;
use srt4rulez\TracyBarDumpHandler;

$logger = new Logger('name');

$logger->pushHandler(new TracyBarDumpHandler());

$logger->debug('BarDump Header', [
    'foo' => 'bar',
]);

Tracy BarDump

You may want to limit this handler to debug level only, with monolog's FilterHandler:

<?php

use Monolog\Logger;
use Monolog\Handler\FilterHandler;
use srt4rulez\TracyBarDumpHandler;

$logger = new Logger('name');

// Only use the tracy bar dump handler with debug level.
$logger->pushHandler(new FilterHandler(new TracyBarDumpHandler(), [Logger::DEBUG, Logger::DEBUG]));

$logger->debug('BarDump Header', [
    'foo' => 'bar',
]);

The 3rd parameter to TracyBarDumpHandler is an options array passed to Tracy\Debugger::barDump():

<?php

use Monolog\Logger;
use srt4rulez\TracyBarDumpHandler;

$logger = new Logger('name');

$logger->pushHandler(new TracyBarDumpHandler(Logger::DEBUG, true, [
    'depth' => 10,
]));

$logger->debug('BarDump Header', [
    'some' => [
        'deep' => [
            'array' => [
                'foo' => [
                    'bar' => [
                        'bar' => [],
                    ]
                ]
            ]
        ]
    ],
]);

See https://github.com/nette/tracy for more info.

License

MIT

Development Testing with Composer

Run the following commands on the application you want to test this composer package on:

# If monolog-tracy-bar-dump-handler is already installed, remove it first.
composer remove srt4rulez/monolog-tracy-bar-dump-handler

# Configures this repo to be setup in composer, assuming its in directory /opt/www
composer config repositories.srt4rulez/monolog-tracy-bar-dump-handler path /opt/www/monolog-tracy-bar-dump-handler

# require our composer repo, but with "@dev" - which will create a symlink to this repo.
composer require srt4rulez/monolog-tracy-bar-dump-handler @dev

You can now make changes to this repo while using it as composer package in another git repo!

NOTE: Make sure you don't commit these changes to your git repo.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-06-28