CoreFiles by mySites.guru
NullLogger.php30 lines, 738 bytes, from Joomla_5.0.0-alpha1-Alpha-Full_Package.zip
Raw History Compare with 4.4.0-alpha4
md5
bdd6aba0adffb237c428ac83ff99b8ae
sha1
c54e0dc951228c55eb5529e252551fcfec5253c9
sha256
b6e81ac620cd55205acc7d6c65d5ed9b0629f8bd108ab23c0b86736bc973dd85
<?php

namespace Psr\Log;

/**
 * This Logger can be used to avoid conditional log calls.
 *
 * Logging should always be optional, and if no logger is provided to your
 * library creating a NullLogger instance to have something to throw logs at
 * is a good way to avoid littering your code with `if ($this->logger) { }`
 * blocks.
 */
class NullLogger extends AbstractLogger
{
    /**
     * Logs with an arbitrary level.
     *
     * @param mixed  $level
     * @param string|\Stringable $message
     * @param array $context
     *
     * @return void
     *
     * @throws \Psr\Log\InvalidArgumentException
     */
    public function log($level, string|\Stringable $message, array $context = []): void
    {
        // noop
    }
}

The same content is in 42 releases, Joomla 5.0.0-alpha1 to 5.2.0-beta1. See them all, or every version of this file.