xref: /plugin/pureldap/vendor/psr/log/Psr/Log/NullLogger.php (revision dad993c57a70866aa1db59c43f043769c2eb7ed0)
1*dad993c5SAndreas Gohr<?php
2*dad993c5SAndreas Gohr
3*dad993c5SAndreas Gohrnamespace Psr\Log;
4*dad993c5SAndreas Gohr
5*dad993c5SAndreas Gohr/**
6*dad993c5SAndreas Gohr * This Logger can be used to avoid conditional log calls.
7*dad993c5SAndreas Gohr *
8*dad993c5SAndreas Gohr * Logging should always be optional, and if no logger is provided to your
9*dad993c5SAndreas Gohr * library creating a NullLogger instance to have something to throw logs at
10*dad993c5SAndreas Gohr * is a good way to avoid littering your code with `if ($this->logger) { }`
11*dad993c5SAndreas Gohr * blocks.
12*dad993c5SAndreas Gohr */
13*dad993c5SAndreas Gohrclass NullLogger extends AbstractLogger
14*dad993c5SAndreas Gohr{
15*dad993c5SAndreas Gohr    /**
16*dad993c5SAndreas Gohr     * Logs with an arbitrary level.
17*dad993c5SAndreas Gohr     *
18*dad993c5SAndreas Gohr     * @param mixed  $level
19*dad993c5SAndreas Gohr     * @param string $message
20*dad993c5SAndreas Gohr     * @param array  $context
21*dad993c5SAndreas Gohr     *
22*dad993c5SAndreas Gohr     * @return void
23*dad993c5SAndreas Gohr     *
24*dad993c5SAndreas Gohr     * @throws \Psr\Log\InvalidArgumentException
25*dad993c5SAndreas Gohr     */
26*dad993c5SAndreas Gohr    public function log($level, $message, array $context = array())
27*dad993c5SAndreas Gohr    {
28*dad993c5SAndreas Gohr        // noop
29*dad993c5SAndreas Gohr    }
30*dad993c5SAndreas Gohr}
31