<div dir="ltr"><br><br><div class="gmail_quote">On Sun, Aug 17, 2008 at 10:56 PM, cdrick <span dir="ltr">&lt;<a href="mailto:cdrick65@gmail.com">cdrick65@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Thanks James and Laurent,<br>
<br>
Actually this question was more to learn is it was possible. I<br>
remember a post about keeping or not comment in the source code...<br>
<br>
To be more precise, it&#39;s for log output of the inference system<br>
(<a href="http://nars.seasidehosting.st/" target="_blank">http://nars.seasidehosting.st/</a>). In each step, there can be something<br>
like 10 lines processes depending on entities are infered. The thing<br>
is this log output chunks are mixed in the code in several places. I<br>
could maybe use a better trigger mechanism like sending a signal with<br>
the entity in question, but still, there will be this message sent (or<br>
the test). I used stream and it seems ok (regarding performance), just<br>
wanted to know if we could deactivate some portion of code as<br>
everything seems possible here ;). I&#39;ll remind the subclass tip<br>
though.</blockquote><div><br><br>&nbsp;Hi Cédrick.<br><br>For this sort of thing, I usually use:<br><br>self assert: [some code].<br><br>When you put your code into production, you can make the implementation of Object&gt;&gt;assert: be a &quot;^self&quot;, which has very little overhead.<br>
<br>You could apply the same to logging, by implementing a similar method:<br><br>self log: [ &#39;Some error occured.&#39; ]. &quot; The return value of the block is logged. &quot;<br></div></div><br>Otherwise Keith Hodges has a logging framework, or you could use Toothpick (<a href="http://www.metaprog.com/Toothpick/">http://www.metaprog.com/Toothpick/</a>) which I believe has a Smalltalk implementation.<br>
<br>Gulik.<br clear="all"><br>-- <br><a href="http://people.squeakfoundation.org/person/mikevdg">http://people.squeakfoundation.org/person/mikevdg</a><br><a href="http://gulik.pbwiki.com/">http://gulik.pbwiki.com/</a><br>

</div>