Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: 4 days ago
JSON representation

Use your best friend for the terminal with your favourite PSR-3 compatible projects

Awesome Lists containing this project

README

        

# climate-logger
Use your best friend for the terminal with your favourite PSR-3 compatible projects

[![Build Status](https://img.shields.io/travis/duncan3dc/climate-logger.svg)](https://travis-ci.org/duncan3dc/climate-logger)
[![Latest Version](https://img.shields.io/packagist/v/duncan3dc/climate-logger.svg)](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.