KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > xdoclet > util > LogUtil


1 /*
2  * Copyright (c) 2001, 2002 The XDoclet team
3  * All rights reserved.
4  */

5 package xdoclet.util;
6
7 import org.apache.commons.logging.Log;
8 import org.apache.commons.logging.LogFactory;
9
10 /**
11  * @author <a HREF="mailto:pathos@pandora.be">Mathias Bogaert</a>
12  * @created 4 mei 2002
13  * @version $Revision: 1.4 $
14  */

15 public final class LogUtil
16 {
17     /**
18      * Returns an instance of Jakarta Commons Log object. For now simply return the classname + name as a log.
19      *
20      * @param clazz Class (will use clazz.getName() to obtain the class name)
21      * @param name Method name
22      * @return a logger for the specified class and method
23      */

24     public static Log getLog(Class JavaDoc clazz, String JavaDoc name)
25     {
26         return LogFactory.getLog(new StringBuffer JavaDoc(clazz.getName()).append('.').append(name).toString());
27     }
28 }
29
Popular Tags