Monolog handler for Google Chrome extension "PHP Console"

Display PHP error/debug log messages in Google Chrome console and notification popups, executes PHP code remotely

Usage:

  1. Install Google Chrome extension https://chrome.google.com/webstore/detail/php-console/nfhmhhlpfleoednkpnnnkolmclajemef
  2. See overview https://github.com/barbushin/php-console#overview
  3. Install PHP Console library https://github.com/barbushin/php-console#installation
  4. Example (result will looks like http://i.hizliresim.com/vg3Pz4.png)

    $logger = new \Monolog\Logger('all', array(new \Monolog\Handler\PHPConsoleHandler()));
    \Monolog\ErrorHandler::register($logger);
    echo $undefinedVar;
    $logger->debug('SELECT * FROM users', array('db', 'time' => 0.012));
    PC::debug($_SERVER); // PHP Console debugger for any type of vars

CloneableInstantiable
ExtendsMonolog\Handler\AbstractProcessingHandler
Monolog\Handler\AbstractHandler
Monolog\Handler\Handler
ImplementsMonolog\Handler\FormattableHandlerInterface
Monolog\Handler\HandlerInterface
Monolog\Handler\ProcessableHandlerInterface
Monolog\ResettableInterface
Methods
public __construct(array $options = [], ?PhpConsole\Connector $connector = NULL, $level = 100, bool $bubble = true)
 
  • throws RuntimeException
public Monolog\Handler\Handler::__destruct()
public Monolog\Handler\Handler::__sleep()
public Monolog\Handler\Handler::close() : void
 

{@inheritdoc}

public Monolog\Handler\AbstractHandler::getBubble() : bool
 

Gets the bubbling behavior.

  • return bool true means that this handler allows bubbling. false means that bubbling is not permitted.
public getConnector() : PhpConsole\Connector
public Monolog\Handler\AbstractProcessingHandler::getFormatter() : Monolog\Formatter\FormatterInterface
 

{@inheritdoc}

public Monolog\Handler\AbstractHandler::getLevel() : int
 

Gets minimum logging level at which this handler will be triggered.

  • return int
public getOptions() : array
public handle(array $record) : bool
public Monolog\Handler\Handler::handleBatch(array $records) : void
 

{@inheritdoc}

public Monolog\Handler\AbstractHandler::isHandling(array $record) : bool
 

{@inheritdoc}

public Monolog\Handler\AbstractProcessingHandler::popProcessor() : callable
 

{@inheritdoc}

public Monolog\Handler\AbstractProcessingHandler::pushProcessor(callable $callback) : Monolog\Handler\HandlerInterface
 

{@inheritdoc}

  • suppress PhanTypeMismatchReturn
public Monolog\Handler\AbstractProcessingHandler::reset()
public Monolog\Handler\AbstractHandler::setBubble(bool $bubble) : self
 

Sets the bubbling behavior.

  • return self
public Monolog\Handler\AbstractProcessingHandler::setFormatter(Monolog\Formatter\FormatterInterface $formatter) : Monolog\Handler\HandlerInterface
 

{@inheritdoc}

  • suppress PhanTypeMismatchReturn
public Monolog\Handler\AbstractHandler::setLevel( $level) : self
 

Sets minimum logging level at which this handler will be triggered.

  • return self
Properties
protected Monolog\Handler\AbstractHandler::$bubble
protected Monolog\Handler\AbstractProcessingHandler::$formatter
 
  • var FormatterInterface
protected Monolog\Handler\AbstractHandler::$level
protected Monolog\Handler\AbstractProcessingHandler::$processors
 
  • var callable[]
Methods
protected getDefaultFormatter() : Monolog\Formatter\FormatterInterface
 

{@inheritDoc}

protected Monolog\Handler\AbstractProcessingHandler::processRecord(array $record) : array
 

Processes a record.

protected Monolog\Handler\AbstractProcessingHandler::resetProcessors() : void
protected write(array $record) : void
 

Writes the record down to the log of the implementing handler

Properties
private $connector
 
  • var Connector
private $options
Methods
private getRecordTags(array $record)
private handleDebugRecord(array $record) : void
private handleErrorRecord(array $record) : void
private handleExceptionRecord(array $record) : void
private initConnector(?PhpConsole\Connector $connector = NULL) : PhpConsole\Connector
 
  • suppress PhanTypeMismatchArgument
private initOptions(array $options) : array
© 2020 Bruce Wells
Search Namespaces \ Classes
ConfigurationNumbers (0-9.) only