[4124] in BarnOwl Developers

home help back first fref pref prev next nref lref last post

Re: [barnowl/barnowl] Perl logging (#54)

daemon@ATHENA.MIT.EDU (Alex Dehnert)
Sun Aug 6 01:38:49 2017

Date: Sat, 05 Aug 2017 22:38:45 -0700
From: Alex Dehnert <notifications@github.com>
Reply-To: barnowl/barnowl <reply+004448c9614bfb66c397395568d82f9bd008fd40d004ac7392cf00000001159e6d6592a169ce00127fe9@reply.github.com>
To: barnowl/barnowl <barnowl@noreply.github.com>
Cc: barnowl-dev email-only account <barnowl-dev@mit.edu>,
        Comment <comment@noreply.github.com>
In-Reply-To: <barnowl/barnowl/pull/54@github.com>


----==_mimepart_5986ab65ac055_184a3fa9cc7b5c2c9969d
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

dehnert commented on this pull request.



> @@ -91,4 +91,34 @@ sub login_extra {
     }
 }
 
+# logging
+sub log_filenames {
+    my ($m) = @_;
+    die "IRC should not be handling non-IRC messages" if lc($m->type) ne "irc";
+    BarnOwl::error("IRC message without a network") if !defined($m->network) || $m->network eq '';
+    my $filename = lc($m->network);
+    if ($m->is_personal) {
+        if ($m->is_incoming) {
+            $filename .= ":" . $m->sender;
+        } elsif ($m->is_outgoing) {
+            $filename .= ":" . $m->recipient;
+        }
+    } else {
+        $filename .= ":" . $m->channel;

Perhaps add a comment here noting that the channel will start with "#".

-- 
You are receiving this because you commented.
Reply to this email directly or view it on GitHub:
https://github.com/barnowl/barnowl/pull/54#pullrequestreview-54527709
----==_mimepart_5986ab65ac055_184a3fa9cc7b5c2c9969d
Content-Type: text/html;
 charset=UTF-8
Content-Transfer-Encoding: 7bit

<p><b>@dehnert</b> commented on this pull request.</p>

<hr>

<p>In <a href="https://github.com/barnowl/barnowl/pull/54#discussion_r131534742">perl/modules/IRC/lib/BarnOwl/Message/IRC.pm</a>:</p>
<pre style='color:#555'>&gt; @@ -91,4 +91,34 @@ sub login_extra {
     }
 }
 
+# logging
+sub log_filenames {
+    my ($m) = @_;
+    die &quot;IRC should not be handling non-IRC messages&quot; if lc($m-&gt;type) ne &quot;irc&quot;;
+    BarnOwl::error(&quot;IRC message without a network&quot;) if !defined($m-&gt;network) || $m-&gt;network eq &#39;&#39;;
+    my $filename = lc($m-&gt;network);
+    if ($m-&gt;is_personal) {
+        if ($m-&gt;is_incoming) {
+            $filename .= &quot;:&quot; . $m-&gt;sender;
+        } elsif ($m-&gt;is_outgoing) {
+            $filename .= &quot;:&quot; . $m-&gt;recipient;
+        }
+    } else {
+        $filename .= &quot;:&quot; . $m-&gt;channel;
</pre>
<p>Perhaps add a comment here noting that the channel will start with "#".</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">&mdash;<br />You are receiving this because you commented.<br />Reply to this email directly, <a href="https://github.com/barnowl/barnowl/pull/54#pullrequestreview-54527709">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AERIyfJRfpPKX_7bUonNR_3XA0mpnlcRks5sVVFlgaJpZM4BW8Zd">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/AERIydRHmF67Bsv75gyaL_lj_kh_UCu5ks5sVVFlgaJpZM4BW8Zd.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/barnowl/barnowl/pull/54#pullrequestreview-54527709"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/barnowl/barnowl","title":"barnowl/barnowl","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/barnowl/barnowl"}},"updates":{"snippets":[{"icon":"PERSON","message":"@dehnert commented on #54"}],"action":{"name":"View Pull Request","url":"https://github.com/barnowl/barnowl/pull/54#pullrequestreview-54527709"}}}</script>
----==_mimepart_5986ab65ac055_184a3fa9cc7b5c2c9969d--

home help back first fref pref prev next nref lref last post