https://github.com/duncan3dc/climate-logger
Use your best friend for the terminal with your favourite PSR-3 compatible projects
https://github.com/duncan3dc/climate-logger
climate php php-league psr-3
Last synced: 9 months ago
JSON representation
Use your best friend for the terminal with your favourite PSR-3 compatible projects
- Host: GitHub
- URL: https://github.com/duncan3dc/climate-logger
- Owner: duncan3dc
- License: apache-2.0
- Created: 2015-03-02T18:21:06.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2019-04-28T13:13:37.000Z (about 7 years ago)
- Last Synced: 2025-02-03T23:27:48.719Z (over 1 year ago)
- Topics: climate, php, php-league, psr-3
- Language: PHP
- Size: 21.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# climate-logger
Use your best friend for the terminal with your favourite PSR-3 compatible projects
[](https://travis-ci.org/duncan3dc/climate-logger)
[](https://packagist.org/packages/duncan3dc/climate-logger)
## CLImate
Read all about CLImate [here](http://climate.thephpleague.com/)
## PSR-3
Read all about PSR-3 [here](http://www.php-fig.org/psr/psr-3/)
## Examples
Combine the two for simple terminal logging:
```php
$somethingThatLogs->setLogger(new \duncan3dc\CLImate\Logger);
```
By default a logger instance will hide DEBUG and log everything else, you can set a specific level like so:
```php
$logger = new \duncan3dc\CLImate\Logger(\Psr\Log\LogLevel::DEBUG);
$somethingThatLogs->setLogger($logger);
```
## Advanced
You can pass your own customised instance of CLImate to the logger:
```php
$climate = new \League\CLImate\CLImate;
$climate->style->addCommand("debug", ["yellow", "background_black"]);
$logger = new \duncan3dc\CLImate\Logger(LogLevel::INFO, $climate);
# Now my debug information will be yellow and black
$somethingThatLogs->setLogger($logger);
```
## Changelog
---------
A [Changelog](CHANGELOG.md) has been available since the beginning of time.