https://github.com/svish/consolelog
PHP class for logging variables to browser console via Chrome Logger protocol.
https://github.com/svish/consolelog
chrome-logger console debugging logging php php-library
Last synced: 11 days ago
JSON representation
PHP class for logging variables to browser console via Chrome Logger protocol.
- Host: GitHub
- URL: https://github.com/svish/consolelog
- Owner: Svish
- License: mit
- Created: 2017-03-08T03:14:17.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-03T07:51:08.000Z (almost 9 years ago)
- Last Synced: 2025-01-11T03:42:56.465Z (over 1 year ago)
- Topics: chrome-logger, console, debugging, logging, php, php-library
- Language: PHP
- Homepage: http://www.chromelogger.com
- Size: 12.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Overview
===



Allows easy server-side logging to browsers supporting the [Chrome Logger](http://www.chromelogger.com) protocol. Either native or via plugins.
Usage
===
```php
use Geekality\ConsoleLog;
ConsoleLog::info('Hello console!');
ConsoleLog::log($_SERVER);
ConsoleLog::warn('something is off with', $object);
ConsoleLog::error('fail');
ConsoleLog::table([
['R1 C1', 'R1 C2'],
['R2 C1', 'R2 C2'],
]);
ConsoleLog::group('Group header');
ConsoleLog::log('Bar');
ConsoleLog::groupEnd();
```
See more examples in [sample/index.php](sample/index.php).
-------
Source
---
Based on [ccampbell/chromephp](http://github.com/ccampbell/chromephp), but more or less a complete rewrite because I found that one hard to extend and adjust in my own project. 😟
Ended up using newer PHP features and simplifying it a bit too, because that's how I roll.
Also called it `ConsoleLog` because I find it weird to use `Chrome` and `Php` in my code, when already writing PHP and I'm viewing the messages in the native Developer Console in FireFox... 🤔 🙂