001package org.apache.commons.jcs3.log; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one or more 005 * contributor license agreements. See the NOTICE file distributed with 006 * this work for additional information regarding copyright ownership. 007 * The ASF licenses this file to You under the Apache license, Version 2.0 008 * (the "License"); you may not use this file except in compliance with 009 * the License. You may obtain a copy of the License at 010 * 011 * http://www.apache.org/licenses/LICENSE-2.0 012 * 013 * Unless required by applicable law or agreed to in writing, software 014 * distributed under the License is distributed on an "AS IS" BASIS, 015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 016 * See the license for the specific language governing permissions and 017 * limitations under the license. 018 */ 019 020/** 021 * This is a SPI factory interface for specialized Log objects 022 */ 023public interface LogFactory 024{ 025 /** 026 * The name of the root Log. 027 */ 028 String ROOT_LOGGER_NAME = ""; 029 030 /** 031 * Return the name of the Log subsystem managed by this factory 032 * 033 * @return the name of the log subsystem 034 */ 035 String getName(); 036 037 /** 038 * Shutdown the logging system if the logging system supports it. 039 */ 040 void shutdown(); 041 042 /** 043 * Returns a Log using the fully qualified name of the Class as the Log 044 * name. 045 * 046 * @param clazz 047 * The Class whose name should be used as the Log name. 048 * @return The Log. 049 * @throws UnsupportedOperationException 050 * if {@code clazz} is {@code null} 051 */ 052 Log getLog(final Class<?> clazz); 053 054 /** 055 * Returns a Log with the specified name. 056 * 057 * @param name 058 * The logger name. 059 * @return The Log. 060 * @throws UnsupportedOperationException 061 * if {@code name} is {@code null} 062 */ 063 Log getLog(final String name); 064}