| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| LoggerFactory |
|
| 1.0;1 |
| 1 | package org.apache.ojb.broker.util.logging; | |
| 2 | ||
| 3 | /* Copyright 2002-2005 The Apache Software Foundation | |
| 4 | * | |
| 5 | * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 6 | * you may not use this file except in compliance with the License. | |
| 7 | * You may obtain a copy of the License at | |
| 8 | * | |
| 9 | * http://www.apache.org/licenses/LICENSE-2.0 | |
| 10 | * | |
| 11 | * Unless required by applicable law or agreed to in writing, software | |
| 12 | * distributed under the License is distributed on an "AS IS" BASIS, | |
| 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 14 | * See the License for the specific language governing permissions and | |
| 15 | * limitations under the License. | |
| 16 | */ | |
| 17 | ||
| 18 | ||
| 19 | /** | |
| 20 | * This is a wrapper thta provides static accessors to LoggerFactoryImpl methods | |
| 21 | * | |
| 22 | * @author Thomas Mahler | |
| 23 | * @author <a href="leandro@ibnetwork.com.br">Leandro Rodrigo Saad Cruz</a> | |
| 24 | * @version $Id: LoggerFactory.java,v 1.1 2007-08-24 22:17:32 ewestfal Exp $ | |
| 25 | */ | |
| 26 | public class LoggerFactory | |
| 27 | { | |
| 28 | ||
| 29 | private static LoggerFactoryImpl getImpl() | |
| 30 | { | |
| 31 | return LoggerFactoryImpl.getInstance(); | |
| 32 | } | |
| 33 | ||
| 34 | /** | |
| 35 | * returns a minimal logger that needs no configuration | |
| 36 | * and can thus be safely used during OJB boot phase | |
| 37 | * (i.e. when OJB.properties have not been loaded). | |
| 38 | * @return Logger the OJB BootLogger | |
| 39 | */ | |
| 40 | public static Logger getBootLogger() | |
| 41 | { | |
| 42 | return getImpl().getBootLogger(); | |
| 43 | } | |
| 44 | ||
| 45 | /** | |
| 46 | * returns the default logger. This Logger can | |
| 47 | * be used when it is not appropriate to use a | |
| 48 | * dedicated fresh Logger instance. | |
| 49 | * @return default Logger | |
| 50 | */ | |
| 51 | public static Logger getDefaultLogger() | |
| 52 | { | |
| 53 | return getImpl().getDefaultLogger(); | |
| 54 | } | |
| 55 | ||
| 56 | /** | |
| 57 | * returns a Logger. The Logger is named | |
| 58 | * after the full qualified name of input parameter clazz | |
| 59 | * @param clazz the Class which name is to be used as name | |
| 60 | * @return Logger the returned Logger | |
| 61 | */ | |
| 62 | public static Logger getLogger(Class clazz) | |
| 63 | { | |
| 64 | return getImpl().getLogger(clazz.getName()); | |
| 65 | } | |
| 66 | ||
| 67 | /** | |
| 68 | * returns a Logger. | |
| 69 | * @param name the name of the Logger | |
| 70 | * @return Logger the returned Logger | |
| 71 | */ | |
| 72 | public static Logger getLogger(String name) | |
| 73 | { | |
| 74 | return getImpl().getLogger(name); | |
| 75 | } | |
| 76 | ||
| 77 | } |