2017 © Pedro Peláez
 

package laravel-chrome-logger

Laravel bridge for ChromePhp. Log PHP output to the Chrome console.

image

digital-drifter/laravel-chrome-logger

Laravel bridge for ChromePhp. Log PHP output to the Chrome console.

  • Friday, April 6, 2018
  • by digital-drifter
  • Repository
  • 1 Watchers
  • 1 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 88 % Grown

The README.md

Log PHP output to the Chrome console

Laravel bridge for ChromePhp., (*1)

Installation

This package requires the Chrome Logger extension., (*2)

Once you've installed the extension, add this package to your project via composer:, (*3)

``` bash $ composer require --dev digital-drifter/laravel-chrome-logger, (*4)


Laravel 5.5 will automatically register the service provider through auto-discovery. Previous versions of the framework just add the service provider in `config/app.php` file: ```php 'providers' => [ // ... DigitalDrifter\LaravelChromeLogger\LaravelChromeLoggerServiceProvider::class, ];

Available Methods

All methods exposed on the ChromePhp class are available. The following comes directly from the class:, (*5)

/**
 * gets instance of this class
 *
 * @return ChromePhp
 */
public static function getInstance();

/**
 * logs a variable to the console
 *
 * @param mixed $data,... unlimited OPTIONAL number of additional logs [...]
 * @return void
 */
public static function log();

/**
 * logs a warning to the console
 *
 * @param mixed $data,... unlimited OPTIONAL number of additional logs [...]
 * @return void
 */
public static function warn();

/**
 * logs an error to the console
 *
 * @param mixed $data,... unlimited OPTIONAL number of additional logs [...]
 * @return void
 */
public static function error();

/**
 * sends a group log
 *
 * @param string value
 */
public static function group();

/**
 * sends an info log
 *
 * @param mixed $data,... unlimited OPTIONAL number of additional logs [...]
 * @return void
 */
public static function info();

/**
 * sends a collapsed group log
 *
 * @param string value
 */
public static function groupCollapsed();

/**
 * ends a group log
 *
 * @param string value
 */
public static function groupEnd();

/**
 * sends a table log
 *
 * @param string value
 */
public static function table();

/**
 * adds a setting
 *
 * @param string key
 * @param mixed value
 * @return void
 */
public function addSetting($key, $value);

/**
 * add ability to set multiple settings in one call
 *
 * @param array $settings
 * @return void
 */
public function addSettings(array $settings);

/**
 * gets a setting
 *
 * @param string key
 * @return mixed
 */
public function getSetting($key);

Usage

Dependency Injection

As with any other class registered in Laravel's service container, you may inject an instance into your code like:, (*6)

use DigitalDrifter\LaravelChromeLogger\LaravelChromeLogger;

...

/**
 * LaravelChromeLogger $logger
 */
protected $logger;

public function __construct(LaravelChromeLogger $logger)
{
    $this->logger = $logger;
}

Facade

Using the provided facade:, (*7)

public function log(string $message)
{
    LaravelChromeLogger::log($message);
}

Helper Method

The console() helper method is available., (*8)

public function log(string $level = "log", string $message)
{
    console($level, $message);
}

Credits

All credit to Craig Cambell for providing the basis to this package., (*9)

The Versions

06/04 2018

dev-master

9999999-dev

Laravel bridge for ChromePhp. Log PHP output to the Chrome console.

  Sources   Download

MIT

The Requires

 

The Development Requires

06/04 2018

1.0.2

1.0.2.0

Laravel bridge for ChromePhp. Log PHP output to the Chrome console.

  Sources   Download

MIT

The Requires

 

The Development Requires

06/04 2018

1.0.1

1.0.1.0

Laravel bridge for ChromePhp. Log PHP output to the Chrome console.

  Sources   Download

MIT

The Requires

 

The Development Requires