commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Trenton D. Adams" <tre...@athabascau.ca>
Subject Re: commons logging class level logging
Date Wed, 30 Mar 2005 19:07:41 GMT
Thanks for the suggestions.  Keep reading...

Thorbjørn Ravn Andersen wrote:
> Trenton D. Adams wrote:
> 
>> Ok, is there a way of my wrapper class starting up, and automatically 
>> detecting all the classes available in every package I specify, and 
>> then setting up loggers for each one?  I mean an easy way.  I could 
>> just search through all the files, and convert them to class names 
>> without the '/' or '\'.
>>
>> If I could do that, then each class could call "log (message, 
>> classname)".
>>
>> Either that, or I could just have the wrapper class setup a static 
>> hashtable of loggers.  When a new log request comes in, I can check 
>> the classname that's passed into the log method, and use it as lookup 
>> into the hashtable of loggers.  If it's not there, make it and add it.
> 
> 
> There is nothing wrong with you creating a utility class that does 
> exactly that (except you probably want to pass a class instead of a 
> classname - so you can pass "this" - which you then get the name for).

Yes, that's cleaner, and less code. :)

> 
> You may also want to investigate how JUnit discovers its testmethods.
> 

Sure, I may try that, thanks.

-- 
Trenton D. Adams
Web Programmer Analyst
Navy Penguins at your service!
Athabasca University
(780) 675-6195
:wq!

__ 
    This communication is intended for the use of the recipient to whom it
    is addressed, and may contain confidential, personal, and or privileged
    information. Please contact us immediately if you are not the intended
    recipient of this communication, and do not copy, distribute, or take
    action relying on it. Any communications received in error, or
    subsequent reply, should be deleted or destroyed.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message