10119ca25SAndreas Gohr<?php 20119ca25SAndreas Gohr 30119ca25SAndreas Gohrnamespace Psr\Log; 40119ca25SAndreas Gohr 50119ca25SAndreas Gohr/** 60119ca25SAndreas Gohr * This Logger can be used to avoid conditional log calls. 70119ca25SAndreas Gohr * 80119ca25SAndreas Gohr * Logging should always be optional, and if no logger is provided to your 90119ca25SAndreas Gohr * library creating a NullLogger instance to have something to throw logs at 100119ca25SAndreas Gohr * is a good way to avoid littering your code with `if ($this->logger) { }` 110119ca25SAndreas Gohr * blocks. 120119ca25SAndreas Gohr */ 130119ca25SAndreas Gohrclass NullLogger extends AbstractLogger 140119ca25SAndreas Gohr{ 150119ca25SAndreas Gohr /** 160119ca25SAndreas Gohr * Logs with an arbitrary level. 170119ca25SAndreas Gohr * 180119ca25SAndreas Gohr * @param mixed $level 190119ca25SAndreas Gohr * @param string $message 200119ca25SAndreas Gohr * @param array $context 210119ca25SAndreas Gohr * 220119ca25SAndreas Gohr * @return void 23*dc4d9dc6SAnna Dabrowska * 24*dc4d9dc6SAnna Dabrowska * @throws \Psr\Log\InvalidArgumentException 250119ca25SAndreas Gohr */ 260119ca25SAndreas Gohr public function log($level, $message, array $context = array()) 270119ca25SAndreas Gohr { 280119ca25SAndreas Gohr // noop 290119ca25SAndreas Gohr } 300119ca25SAndreas Gohr} 31