<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Nette Framework forum : Development of Nette Framework : RFC – Request for Comments : Notifiers for Tracy\Debugger</title>
<link>https://forum.nette.org/en</link>
<description>Nette Framework forum</description>
<language>en</language>
<docs>http://backend.userland.com/rss</docs>
<item>
	<title>Notifiers for Tracy\Debugger (RFC – Request for Comments)</title>
	<dc:creator>Jan Tvrdík</dc:creator>
	<link>https://forum.nette.org/en/24668#p177334</link>
	<guid isPermaLink="false">177334@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;Why not use Monolog?&lt;/p&gt;
</description>
	<pubDate>Wed, 27 Jul 2016 15:35:47 +0200</pubDate>
</item>
<item>
	<title>Notifiers for Tracy\Debugger (RFC – Request for Comments)</title>
	<dc:creator>finwe</dc:creator>
	<link>https://forum.nette.org/en/24668#p177325</link>
	<guid isPermaLink="false">177325@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;Made a WIP PR. Comments appreciated. &lt;a
href=&quot;https://github.com/nette/tracy/pull/210&quot;&gt;https://github.com/…acy/pull/210&lt;/a&gt;&lt;/p&gt;
</description>
	<pubDate>Wed, 27 Jul 2016 13:43:32 +0200</pubDate>
</item>
<item>
	<title>Notifiers for Tracy\Debugger (RFC – Request for Comments)</title>
	<dc:creator>finwe</dc:creator>
	<link>https://forum.nette.org/en/24668#p164487</link>
	<guid isPermaLink="false">164487@http://forum.nette.org/en</guid>
	<description>&lt;p&gt;The e-mail notifications are too tightly integrated to the
&lt;code&gt;Logger&lt;/code&gt; class – when wanting to notify some other channels
(mainly 3rd party APIs) I would have to extend the base logger class and edit
the &lt;code&gt;Logger::log()&lt;/code&gt; method.&lt;/p&gt;

&lt;h4&gt;Proposition&lt;/h4&gt;

&lt;p&gt;Introduce a &lt;code&gt;Logger::$notifiers&lt;/code&gt; property with an array of
&lt;code&gt;Tracy\INotifier&lt;/code&gt; interface instances:&lt;/p&gt;

&lt;pre
class=&quot;language-php&quot;&gt;&lt;code&gt;
&amp;lt;?php

namespace Tracy;

interface INotifier
{

	public function notify($message);

}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Base &lt;code&gt;Logger::log()&lt;/code&gt; method would then be changed from&lt;/p&gt;

&lt;pre
class=&quot;language-php&quot;&gt;&lt;code&gt;if (in_array($priority, array(self::ERROR, self::EXCEPTION, self::CRITICAL), TRUE)) {
	$this-&amp;gt;sendEmail($message);
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;to&lt;/p&gt;

&lt;pre
class=&quot;language-php&quot;&gt;&lt;code&gt;foreach (self::$notifiers as $notifier) {
	$notifier-&amp;gt;notify($message);
}&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Error levels to notify would be handled by &lt;code&gt;INotifier&lt;/code&gt;
implementation.&lt;/p&gt;

&lt;h4&gt;Backwards compatibility&lt;/h4&gt;

&lt;p&gt;Basic &lt;code&gt;EmailNotifier&lt;/code&gt; would be included in distribution and
automatically set up on &lt;code&gt;Debugger&lt;/code&gt; enabling. Also
&lt;code&gt;Debugger::$email&lt;/code&gt;, &lt;code&gt;Debugger::$mailer&lt;/code&gt; and other related
variables would be transferred to said notifier settings.&lt;/p&gt;

&lt;p&gt;I propose removing e-mail related settings from Debugger class in the next
significant version.&lt;/p&gt;
</description>
	<pubDate>Thu, 29 Oct 2015 11:55:52 +0100</pubDate>
</item>
</channel>
</rss>
