Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/akshaykhale1992/console-logger
A simple Browser Console logger for PHP Scripts.
https://github.com/akshaykhale1992/console-logger
composer composer-package console-log console-logger
Last synced: 3 months ago
JSON representation
A simple Browser Console logger for PHP Scripts.
- Host: GitHub
- URL: https://github.com/akshaykhale1992/console-logger
- Owner: akshaykhale1992
- Created: 2020-06-24T08:59:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-06-24T14:34:43.000Z (over 4 years ago)
- Last Synced: 2024-07-31T14:10:58.515Z (6 months ago)
- Topics: composer, composer-package, console-log, console-logger
- Language: PHP
- Homepage: https://akshaykhale1992.github.io/console-logger/
- Size: 8.79 KB
- Stars: 13
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A simple Browser Console Logger for PHP
[![scrutinizer build status](https://scrutinizer-ci.com/g/akshaykhale1992/console-logger/badges/build.png?b=master)](https://scrutinizer-ci.com/g/akshaykhale1992/console-logger/?branch=master)
[![scrutinizer version code](https://scrutinizer-ci.com/g/akshaykhale1992/console-logger/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/akshaykhale1992/console-logger/?branch=master)## How it started ?
We all have been in situations where we wanted to step through the code by logging the variable details. Most of the time we simply do.
print_r($variable);die();
And I find this process tedious, stopping for a simple variable log. I wanted a simple console log just like Javascript which is my inspiration behind creating console logger.
It is similar console log, it follows [PSR-3: Logger Interface](https://www.php-fig.org/psr/psr-3/) standards so you don't have to learn anything new.
## How to use it ?
1. Install the Package using composer
composer require akshaykhale1992/console-logger
2. User the LoggerSample Code:
emergency("This is from Server Side");
(new Logger())->alert("This is from Server Side");
(new Logger())->critical("This is from Server Side");
(new Logger())->error("This is from Server Side");
(new Logger())->warning("This is from Server Side");
(new Logger())->notice("This is from Server Side");
(new Logger())->info("This is from Server Side");
(new Logger())->debug("This is from Server Side");
(new Logger())->group("'Group 1'");
(new Logger())->info("This is from a Group 1");
(new Logger())->info("This is from a Group 2");
(new Logger())->info("This is from a Group 3");
(new Logger())->groupEnd();
(new Logger())->info("This is from Server Side", ['this' => 'is', 'an' => 'Array']);
(new Logger())->info("This is from Server Side", ['this', 'is', 'a', 'simple', 'Array']);## To-DO
- Adding Test cases.