KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > framework > logging > Sync4jLogger


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18
19 package sync4j.framework.logging;
20
21 import java.util.logging.Logger JavaDoc;
22
23 /**
24  * Provides a common logging facility for the framework.
25  * <p>
26  * The verbosity of the log can be set in the JDK logging properties files
27  * giving one of the following values (case insensitively):
28  * <ul>
29  * <li>SEVERE
30  * <li>WARNING
31  * <li>INFO
32  * <li>CONFIG
33  * <li>FINE
34  * <li>FINER
35  * <li>FINEST
36  * <li>ALL
37  * </ul>
38  *
39  * For example, for the Sync4j default logger, you can specify:
40  * <pre>
41  * sync4j.level=SEVERE
42  * </pre>
43  *
44  * @author Stefano Fornari @ Funambol.com
45  * @version $Id
46  */

47 public class Sync4jLogger {
48     
49     public static final String JavaDoc LOG_NAME = "sync4j";
50     
51     /**
52      * Returns the Sync4j default logger
53      *
54      * @return the Sync4j default logger
55      */

56     public static Logger JavaDoc getLogger() {
57         return Logger.getLogger(LOG_NAME);
58     }
59     
60     /**
61      * Returns the logger associated with the name <i>LOG_NAME</i>.name.
62      *
63      * @param name the subname of the logger.
64      *
65      * @return the logger associated with the name <i>LOG_NAME</i>.name.
66      */

67     public static Logger JavaDoc getLogger(String JavaDoc name) {
68         return Logger.getLogger(LOG_NAME + '.' + name);
69     }
70 }
Popular Tags