duncan3dc/logger-aware-trait

A PSR-3 trait allowing any class to easily add logger support

0.2.0 2017-08-24 15:08 UTC

README

A PSR-3 trait allowing any class to easily add logger support

Latest Stable Version Build Status Coverage Status

Installing

The recommended method of installing this library is via Composer.

Run the following command from your project root:

$ composer require duncan3dc/logger-aware-trait

Setup

Simply apply the trait to your classes:

use duncan3dc\Log\LoggerAwareTrait;

class MyClass
{
    use LoggerAwareTrait;
}

Now the class will have a getLogger() method that you can safely call.
If a logger has been injected using setLogger() then that logger will be provided, otherwise a NullLogger will be used instead.

Changelog

A Changelog has been available since the beginning of time

Where to get help

Found a bug? Got a question? Just not sure how something works?
Please create an issue and I'll do my best to help out.
Alternatively you can catch me on Twitter