bkdotcom / PHPDebugConsole

Browser/javascript-like logger/console class for PHP
http://www.bradkent.com/php/debug
Other
78 stars 5 forks source link
firephp logger-interface monolog psr3

PHPDebugConsole

Browser/javascript like console class for PHP

Website/Usage/Examples: http://www.bradkent.com/php/debug

Screenshot of PHPDebugConsole's Output

Installation

This library supports PHP 5.4 - 8.4

It is installable and autoloadable via Composer as bdk/debug.

{
    "require": {
        "bdk/debug": "^3.2",
    }
}

installation without Composer

As of v3.3 this is no longer officially supported due to now requiring one or more dependencies.

Usage

See http://www.bradkent.com/php/debug

PSR-3 Usage

PHPDebugConsole includes a PSR-3 implementation (which can be used as a monolog PSR handler). If you're using a application or library that uses these standards, drop PHPDebugConsole right in.

(this library includes neither psr/log or monolog/monolog. Include separately if needed.)

PSR-3:

// instantiate PHPDebugLogger / get instance
$debug = \bdk\Debug::getInstance();
$psr3logger = $debug->logger;
$psr3logger->emergency('fallen and can\'t get up');

monolog:

$monolog = new \Monolog\Logger('myApplication');
$monolog->pushHandler(new \bdk\Debug\Collector\MonologHandler($debug));
$monolog->critical('all your base are belong to them');

Methods

Tests / Quality

Supported PHP versions Build Status Codacy Score Maintainability Coverage

Changelog

http://www.bradkent.com/php/debug#changelog