streams/vendor/psr/log
Klaus Weidenbach 745515b11f [FEATURE] Add config and use composer autoloader.
We use composer already to install SabreDAV. Include config
composer.(json|lock) to install and manage more dependencies
in future.
Also provide PSR-4 autoloading for our namespaced classes, e.g.
"Zotlabs\". To regenerate autoloader maps use:
$ composer install --optimize-autoloader --no-dev

We could also remove the whole vendor/ folder from our repository, but
that would need changes in deployment and how to install hubs and needs
more discussion first.
2016-10-18 18:11:41 +02:00
..
Psr/Log [FEATURE] Add config and use composer autoloader. 2016-10-18 18:11:41 +02:00
.gitignore upgrade to sabre32 2016-05-28 17:46:24 +02:00
composer.json [FEATURE] Add config and use composer autoloader. 2016-10-18 18:11:41 +02:00
LICENSE upgrade to sabre32 2016-05-28 17:46:24 +02:00
README.md upgrade to sabre32 2016-05-28 17:46:24 +02:00

PSR Log

This repository holds all interfaces/classes/traits related to PSR-3.

Note that this is not a logger of its own. It is merely an interface that describes a logger. See the specification for more details.

Usage

If you need a logger, you can use the interface like this:

<?php

use Psr\Log\LoggerInterface;

class Foo
{
    private $logger;

    public function __construct(LoggerInterface $logger = null)
    {
        $this->logger = $logger;
    }

    public function doSomething()
    {
        if ($this->logger) {
            $this->logger->info('Doing work');
        }

        // do something useful
    }
}

You can then pick one of the implementations of the interface to get a logger.

If you want to implement the interface, you can require this package and implement Psr\Log\LoggerInterface in your code. Please read the specification text for details.