001 package org.apache.ojb.broker.util.logging;
002
003 /* Copyright 2002-2005 The Apache Software Foundation
004 *
005 * Licensed under the Apache License, Version 2.0 (the "License");
006 * you may not use this file except in compliance with the License.
007 * You may obtain a copy of the License at
008 *
009 * http://www.apache.org/licenses/LICENSE-2.0
010 *
011 * Unless required by applicable law or agreed to in writing, software
012 * distributed under the License is distributed on an "AS IS" BASIS,
013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014 * See the License for the specific language governing permissions and
015 * limitations under the License.
016 */
017
018
019 /**
020 * This is a wrapper thta provides static accessors to LoggerFactoryImpl methods
021 *
022 * @author Thomas Mahler
023 * @author <a href="leandro@ibnetwork.com.br">Leandro Rodrigo Saad Cruz</a>
024 * @version $Id: LoggerFactory.java,v 1.1 2007-08-24 22:17:32 ewestfal Exp $
025 */
026 public class LoggerFactory
027 {
028
029 private static LoggerFactoryImpl getImpl()
030 {
031 return LoggerFactoryImpl.getInstance();
032 }
033
034 /**
035 * returns a minimal logger that needs no configuration
036 * and can thus be safely used during OJB boot phase
037 * (i.e. when OJB.properties have not been loaded).
038 * @return Logger the OJB BootLogger
039 */
040 public static Logger getBootLogger()
041 {
042 return getImpl().getBootLogger();
043 }
044
045 /**
046 * returns the default logger. This Logger can
047 * be used when it is not appropriate to use a
048 * dedicated fresh Logger instance.
049 * @return default Logger
050 */
051 public static Logger getDefaultLogger()
052 {
053 return getImpl().getDefaultLogger();
054 }
055
056 /**
057 * returns a Logger. The Logger is named
058 * after the full qualified name of input parameter clazz
059 * @param clazz the Class which name is to be used as name
060 * @return Logger the returned Logger
061 */
062 public static Logger getLogger(Class clazz)
063 {
064 return getImpl().getLogger(clazz.getName());
065 }
066
067 /**
068 * returns a Logger.
069 * @param name the name of the Logger
070 * @return Logger the returned Logger
071 */
072 public static Logger getLogger(String name)
073 {
074 return getImpl().getLogger(name);
075 }
076
077 }