3 namespace Friendica\Util\Logger;
9 * Simple handler for Friendica developers to use for deeper logging
11 * If you want to debug only interactions from your IP or the IP of a remote server for federation debug,
12 * you'll use Logger::develop() for the duration of your work, and you clean it up when you're done before submitting your PR.
14 class FriendicaDevelopHandler extends Handler\AbstractHandler
17 * @var string The IP of the developer who wants to debug
22 * @param string $developerIp The IP of the developer who wants to debug
23 * @param int $level The minimum logging level at which this handler will be triggered
24 * @param bool $bubble Whether the messages that are handled can bubble up the stack or not
26 public function __construct($developerIp, $level = Logger::DEBUG, $bubble = true)
28 parent::__construct($level, $bubble);
30 $this->developerIp = $developerIp;
36 public function handle(array $record)
38 if (!$this->isHandling($record)) {
42 /// Just in case the remote IP is the same as the developer IP log the output
43 if (!is_null($this->developerIp) && $_SERVER['REMOTE_ADDR'] != $this->developerIp)
48 return false === $this->bubble;