<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Misadventures of a Celtic Geek &#187; Javascript</title>
	<atom:link href="http://blog.guesny.net/category/javascript/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.guesny.net</link>
	<description>Just another WordPress site</description>
	<lastBuildDate>Sun, 03 Jun 2012 19:25:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Presenting ring_logger v0.1</title>
		<link>http://blog.guesny.net/2008/02/25/presenting-ring_logger-v01/</link>
		<comments>http://blog.guesny.net/2008/02/25/presenting-ring_logger-v01/#comments</comments>
		<pubDate>Mon, 25 Feb 2008 14:26:10 +0000</pubDate>
		<dc:creator>welsh_dwarf</dc:creator>
				<category><![CDATA[english]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.guesny.net/index.php/2008/02/25/presenting-ring_logger-v01/</guid>
		<description><![CDATA[Â Ring logger This weekend, I had an urge to catch up on one of the umpteen projects that I&#8217;d like to start, so I attacked a ring logger. Basically, a ring logger, keeps the log messages in a ring buffer, &#8230; <a href="http://blog.guesny.net/2008/02/25/presenting-ring_logger-v01/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><strong>Â Ring logger</strong></p>
<p>This weekend, I had an urge to catch up on one of the umpteen projects that I&#8217;d like to start, so I attacked a ring logger.</p>
<p>Basically, a ring logger, keeps the log messages in a ring buffer, which can be dumped when interesting circumstances arrise.</p>
<p>The particularité of this one is that it&#8217;s pure javascript, and dumps as a &#8216;POST&#8217; request to a url. This allows for much improved debugging of js-rich web pages, whilst not filling up the web browsers memory with useless logs.</p>
<p>It depends on <a href="http://http://sourceforge.net/projects/toutoujs" title="ToutouJS" target="_blank">ToutouJS</a> but doesn&#8217;t have a lot of calls, so it should be easilly portable if anyone finds the need.</p>
<p><strong>Â Usage</strong></p>
<p>First off, you have to include the relevent files:</p>
<blockquote>
<pre lang="HTML">
<script src="js/toutou/toutou.js" type="text/javascript"></script>
<script src="ring_log.js" type="text/javascript"></script></pre>
</blockquote>
<p>Then you just log away (the mores the better):</p>
<blockquote>
<pre lang="Javascript">
js.ring_log.log(js.ring_log.DEBUG,'Test','Test message');</pre>
</blockquote>
<p>Finally, to retrieve your log, ie dump the buffer:</p>
<blockquote>
<pre lang="Javascript">
js.ring_log.dump();</pre>
</blockquote>
<p>Et voila!</p>
<p>For testing purposes, the logger is pre-configured to call a script log.php in the same directory as it is in, and has a buffer size of 10, both parameters changeable in the source. The different parts of the log messages are seperated by a &#8216;splitter&#8217;, by default &#8216;==|==&#8217;, this is also configurable.</p>
<blockquote>
<pre lang="javascript">
js.ring_log.requestUri='log.php';
js.ring_log.log_data_size=10;
js.ring_log.splitter='==|==';</pre>
</blockquote>
<p>And that&#8217;s just about it, hope you find it usefull <img src='http://blog.guesny.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Update: forgot to add the<a href="http://www.guesny.net/ring_log.tgz" title="Ring logger"> .tgz</a>, oups :$</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.guesny.net/2008/02/25/presenting-ring_logger-v01/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

