| 1 | package org.apache.commons.jcs3.log; |
| 2 | |
| 3 | /* |
| 4 | * Licensed to the Apache Software Foundation (ASF) under one or more |
| 5 | * contributor license agreements. See the NOTICE file distributed with |
| 6 | * this work for additional information regarding copyright ownership. |
| 7 | * The ASF licenses this file to You under the Apache license, Version 2.0 |
| 8 | * (the "License"); you may not use this file except in compliance with |
| 9 | * the License. You may obtain a copy of the License at |
| 10 | * |
| 11 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | * |
| 13 | * Unless required by applicable law or agreed to in writing, software |
| 14 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | * See the license for the specific language governing permissions and |
| 17 | * limitations under the license. |
| 18 | */ |
| 19 | |
| 20 | /** |
| 21 | * This is a SPI factory interface for specialized Log objects |
| 22 | */ |
| 23 | public interface LogFactory |
| 24 | { |
| 25 | /** |
| 26 | * The name of the root Log. |
| 27 | */ |
| 28 | String ROOT_LOGGER_NAME = ""; |
| 29 | |
| 30 | /** |
| 31 | * Return the name of the Log subsystem managed by this factory |
| 32 | * |
| 33 | * @return the name of the log subsystem |
| 34 | */ |
| 35 | String getName(); |
| 36 | |
| 37 | /** |
| 38 | * Shutdown the logging system if the logging system supports it. |
| 39 | */ |
| 40 | void shutdown(); |
| 41 | |
| 42 | /** |
| 43 | * Returns a Log using the fully qualified name of the Class as the Log |
| 44 | * name. |
| 45 | * |
| 46 | * @param clazz |
| 47 | * The Class whose name should be used as the Log name. |
| 48 | * @return The Log. |
| 49 | * @throws UnsupportedOperationException |
| 50 | * if {@code clazz} is {@code null} |
| 51 | */ |
| 52 | Log getLog(final Class<?> clazz); |
| 53 | |
| 54 | /** |
| 55 | * Returns a Log with the specified name. |
| 56 | * |
| 57 | * @param name |
| 58 | * The logger name. |
| 59 | * @return The Log. |
| 60 | * @throws UnsupportedOperationException |
| 61 | * if {@code name} is {@code null} |
| 62 | */ |
| 63 | Log getLog(final String name); |
| 64 | } |