Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 11441 invoked from network); 30 Mar 2005 18:56:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Mar 2005 18:56:43 -0000 Received: (qmail 17741 invoked by uid 500); 30 Mar 2005 18:56:38 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 17725 invoked by uid 500); 30 Mar 2005 18:56:38 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 17711 invoked by uid 99); 30 Mar 2005 18:56:38 -0000 X-ASF-Spam-Status: No, hits=0.4 required=10.0 tests=DNS_FROM_RFC_ABUSE,RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of thunderaxiom@gmail.com designates 64.233.184.207 as permitted sender) Received: from wproxy.gmail.com (HELO wproxy.gmail.com) (64.233.184.207) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 30 Mar 2005 10:56:37 -0800 Received: by wproxy.gmail.com with SMTP id 71so368028wri for ; Wed, 30 Mar 2005 10:56:35 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=Hglx+K4ODHY1G3lyNFEkIzSy2pb3dsvaYK6XRxZ9/bnKOvN4OV/XCF37nrGA1hDAh0G3Bg8o6OhxJ3TNo2vKaFu1toLhvLDN6VNVtaWoq/Gg5qJKrdph1S+yWR4KnC0yrfyVeWChhKEBJD0NUxeqQDhcAEd/yXTVfq7TjrjM3kc= Received: by 10.54.35.65 with SMTP id i65mr140839wri; Wed, 30 Mar 2005 10:56:35 -0800 (PST) Received: from ?192.168.1.2? ([80.198.62.44]) by mx.gmail.com with ESMTP id 45sm146255wri.2005.03.30.10.56.34; Wed, 30 Mar 2005 10:56:35 -0800 (PST) Message-ID: <424AF65F.10600@gmail.com> Date: Wed, 30 Mar 2005 20:56:31 +0200 From: =?ISO-8859-1?Q?Thorbj=F8rn_Ravn_Andersen?= User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Jakarta Commons Users List Subject: Re: commons logging class level logging References: <4876153C00898F43B189AF95F84BCE148E23EE@usilms28.ca.com> <424A440C.30900@gmail.com> <424AE72A.90408@athabascau.ca> In-Reply-To: <424AE72A.90408@athabascau.ca> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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). You may also want to investigate how JUnit discovers its testmethods. -- Thorbj�rn --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org