2017 © Pedro Peláez
 

library logger-pool

The pool of different loggers wich impliments \PSR\Log\LoggerInterface

image

elementary/logger-pool

The pool of different loggers wich impliments \PSR\Log\LoggerInterface

  • Monday, March 19, 2018
  • by elementary
  • Repository
  • 1 Watchers
  • 0 Stars
  • 67 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 14 % Grown

The README.md

The pool of different loggers wich impliments \PSR\Log\LoggerInterface

Latest Stable Version License Build Status Coverage Status, (*1)

Installation

The preferred way to install this extension is through composer and then run, (*2)

composer require elementary/logger-pool

Usage

use elementary\logger\pool\LoggerPool;
use elementary\logger\traits\LoggerGetInterface;
use elementary\logger\traits\LoggerTrait;
use elementary\logger\graylog\udp\GraylogUdp;
use Psr\Log\LoggerAwareInterface;
use Psr\Log\NullLogger;

class Example implements LoggerGetInterface, LoggerAwareInterface
{
    use LoggerTrait;

    public function doSomeThing()
    {
        // Do some thing
        $this->getLogger()->debug('do some thing');

        // Runtime error should be logged and monitored
        $this->getLogger()->error('Attantion! The error was happened!');
    }
}

LoggerPool::me()->setLogger(new NullLogger());
LoggerPool::me()->setLogger(new GraylogUdp('test', 'localhost', 12201), 'warning');

$ex = new Example();
$ex->setLogger(LoggerPool::me());
$ex->doSomeThing();

Testing and Code coverage

Unit Tests are located in tests directory. You can run your tests and collect coverage with the following command:, (*3)

vendor/bin/phpunit

Result of coverage will be output into the tests/output directory., (*4)

License

For license information check the LICENSE-file., (*5)

The Versions

19/03 2018

dev-master

9999999-dev

The pool of different loggers wich impliments \PSR\Log\LoggerInterface

  Sources   Download

MIT

The Requires

 

The Development Requires

by Artiom Vendelev

19/03 2018

1.0.1

1.0.1.0

The pool of different loggers wich impliments \PSR\Log\LoggerInterface

  Sources   Download

MIT

The Requires

 

The Development Requires

by Artiom Vendelev

15/03 2018

1.0.0

1.0.0.0

Extend \Psr\Log\LoggerAwareTrait

  Sources   Download

MIT

The Requires

 

by Artiom Vendelev