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