<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: On handling logging in a script</title>
	<atom:link href="http://www.dannorris.com/2008/01/11/on-handling-logging-in-a-script/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dannorris.com/2008/01/11/on-handling-logging-in-a-script/</link>
	<description></description>
	<pubDate>Thu, 20 Nov 2008 07:27:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
		<item>
		<title>By: billy</title>
		<link>http://www.dannorris.com/2008/01/11/on-handling-logging-in-a-script/#comment-862</link>
		<dc:creator>billy</dc:creator>
		<pubDate>Fri, 18 Jan 2008 00:55:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.dannorris.com/2008/01/11/on-handling-logging-in-a-script/#comment-862</guid>
		<description>no kilt no way.  too cold, the boyz will freeze.</description>
		<content:encoded><![CDATA[<p>no kilt no way.  too cold, the boyz will freeze.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.dannorris.com/2008/01/11/on-handling-logging-in-a-script/#comment-850</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Fri, 11 Jan 2008 13:54:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.dannorris.com/2008/01/11/on-handling-logging-in-a-script/#comment-850</guid>
		<description>That's a nice way to handle it. I don't agree that it makes the script code easier to read with lots of parens hanging around, but I still think it's a useful technique--I like the filtering too. 

Thanks for the nice tip!</description>
		<content:encoded><![CDATA[<p>That&#8217;s a nice way to handle it. I don&#8217;t agree that it makes the script code easier to read with lots of parens hanging around, but I still think it&#8217;s a useful technique&#8211;I like the filtering too. </p>
<p>Thanks for the nice tip!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nigel Thomas</title>
		<link>http://www.dannorris.com/2008/01/11/on-handling-logging-in-a-script/#comment-849</link>
		<dc:creator>Nigel Thomas</dc:creator>
		<pubDate>Fri, 11 Jan 2008 09:55:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.dannorris.com/2008/01/11/on-handling-logging-in-a-script/#comment-849</guid>
		<description>Dan

Another approach (which also works on Windows) is to place the commands you want to log into a bracketed section

(
commands to be logged
more commands to be logged
) &#62; $LOG

This has the added benefit on *nix that you can easily tee and grep the output. So you can log *everything* to a file, but filter out (say) significant progress and error messages. I tend to start my messages with == (the more equals signs, the more important) and then you can filter messages by how many == they have:

(
commands
) &#124; tee $log &#124; grep "^==="

Of course on *nix you can also redirect stderr at the same time in the usual way(s) eg:

(
commands
) &#62;2&#38;1 &#62;$LOG

I think using brackets (braces) like this is easier to read - and you can nest the brackets too. Just make sure you match brackets properly.

Regards Nigel</description>
		<content:encoded><![CDATA[<p>Dan</p>
<p>Another approach (which also works on Windows) is to place the commands you want to log into a bracketed section</p>
<p>(<br />
commands to be logged<br />
more commands to be logged<br />
) &gt; $LOG</p>
<p>This has the added benefit on *nix that you can easily tee and grep the output. So you can log *everything* to a file, but filter out (say) significant progress and error messages. I tend to start my messages with == (the more equals signs, the more important) and then you can filter messages by how many == they have:</p>
<p>(<br />
commands<br />
) | tee $log | grep &#8220;^===&#8221;</p>
<p>Of course on *nix you can also redirect stderr at the same time in the usual way(s) eg:</p>
<p>(<br />
commands<br />
) &gt;2&amp;1 &gt;$LOG</p>
<p>I think using brackets (braces) like this is easier to read - and you can nest the brackets too. Just make sure you match brackets properly.</p>
<p>Regards Nigel</p>
]]></content:encoded>
	</item>
</channel>
</rss>
