<div class="gmail_quote">On Sat, May 7, 2011 at 4:17 PM, Jose Armando Garcia <span dir="ltr"><<a href="mailto:jsancio@gmail.com">jsancio@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Hey folks,<br>
<br>
For the past couple of days I took the liberty of partially<br>
implementing a logging module for D. I say partially because all the<br>
features that I want to implement are not currently implement. You<br>
should really look at the implementation more as a proof of concept<br>
even thought most of the code will be used in the final<br>
implementation.<br>
<br>
That been said I am really interested in getting some feedback on the<br>
API. That includes high-level design (e.g. using a thread to perform<br>
logging. On that note I am planning to also have a shared memory<br>
implementation), interfaces and the documentation.<br>
<br>
When making comment be aware that the design goals of the module are:<br>
1) Provide a logging mechanism that is easy to use in the common case.<br>
2) The module should allow for as much configuration as possible at<br>
compile time and execution time without breaking design goal 1.<br>
3) It should be possible to extend or replace the backend without<br>
breaking the semantic exposed by the API.<br>
<br>
I am fairly new to the D language so any comment on how I can take<br>
advantage of D idiom or D features in the API or implementation would<br>
be greatly appreciated.<br>
<br>
My intent, and hopefully we will get there with your help, is to<br>
include this in Phobos for D2.<br>
<br>
</div>logging.d - <a href="http://ubuntuone.com/p/rfL/" target="_blank">http://ubuntuone.com/p/rfL/</a><br>
logging.html - <a href="http://ubuntuone.com/p/rfM/" target="_blank">http://ubuntuone.com/p/rfM/</a><br>
<div class="im"><br>
Thanks,<br>
-Jose<br></div></blockquote><div><br></div><div><br></div><div>I'll be sure to try it out in the next few days. Passing messages to a separate logging thread seems like it might be a overkill, but it could work. I do like that you can get the file and line included with messages.</div>
<div>One thing I'll miss from Log4J and its siblings is that typing <a href="http://log.info">log.info</a>("message") is a lot more intuitive than log(LogLevel.info, "message"). I don't think that's a major gripe though.</div>
</div>