001/* 002 * Licensed to the Apache Software Foundation (ASF) under one or more 003 * contributor license agreements. See the NOTICE file distributed with 004 * this work for additional information regarding copyright ownership. 005 * The ASF licenses this file to You under the Apache license, Version 2.0 006 * (the "License"); you may not use this file except in compliance with 007 * the License. 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 */ 017package org.apache.logging.log4j.spi; 018 019import org.apache.logging.log4j.Level; 020import org.apache.logging.log4j.Logger; 021import org.apache.logging.log4j.Marker; 022import org.apache.logging.log4j.message.Message; 023 024/** 025 * Extends the {@code Logger} interface with methods that facilitate implementing or extending {@code Logger}s. Users 026 * should not need to use this interface. 027 */ 028public interface ExtendedLogger extends Logger { 029 030 /** 031 * Determines if logging is enabled. 032 * 033 * @param level The logging Level to check. 034 * @param marker A Marker or null. 035 * @param message The Message. 036 * @param t A Throwable. 037 * @return True if logging is enabled, false otherwise. 038 */ 039 boolean isEnabled(Level level, Marker marker, Message message, Throwable t); 040 041 /** 042 * Determines if logging is enabled. 043 * 044 * @param level The logging Level to check. 045 * @param marker A Marker or null. 046 * @param message The message. 047 * @param t A Throwable. 048 * @return True if logging is enabled, false otherwise. 049 */ 050 boolean isEnabled(Level level, Marker marker, Object message, Throwable t); 051 052 /** 053 * Determines if logging is enabled. 054 * 055 * @param level The logging Level to check. 056 * @param marker A Marker or null. 057 * @param message The message. 058 * @return True if logging is enabled, false otherwise. 059 * @param t the exception to log, including its stack trace. 060 */ 061 boolean isEnabled(Level level, Marker marker, String message, Throwable t); 062 063 /** 064 * Determine if logging is enabled. 065 * 066 * @param level The logging Level to check. 067 * @param marker A Marker or null. 068 * @param message The message. 069 * @return True if logging is enabled, false otherwise. 070 */ 071 boolean isEnabled(Level level, Marker marker, String message); 072 073 /** 074 * Determines if logging is enabled. 075 * 076 * @param level The logging Level to check. 077 * @param marker A Marker or null. 078 * @param message The message. 079 * @param params The parameters. 080 * @return True if logging is enabled, false otherwise. 081 */ 082 boolean isEnabled(Level level, Marker marker, String message, Object... params); 083 084 /** 085 * Logs a message if the specified level is active. 086 * 087 * @param fqcn The fully qualified class name of the logger entry point, used to determine the caller class and 088 * method when location information needs to be logged. 089 * @param level The logging Level to check. 090 * @param marker A Marker or null. 091 * @param message The Message. 092 * @param t the exception to log, including its stack trace. 093 */ 094 void logIfEnabled(String fqcn, Level level, Marker marker, Message message, Throwable t); 095 096 /** 097 * Logs a message if the specified level is active. 098 * 099 * @param fqcn The fully qualified class name of the logger entry point, used to determine the caller class and 100 * method when location information needs to be logged. 101 * @param level The logging Level to check. 102 * @param marker A Marker or null. 103 * @param message The message. 104 * @param t the exception to log, including its stack trace. 105 */ 106 void logIfEnabled(String fqcn, Level level, Marker marker, Object message, Throwable t); 107 108 /** 109 * Logs a message if the specified level is active. 110 * 111 * @param fqcn The fully qualified class name of the logger entry point, used to determine the caller class and 112 * method when location information needs to be logged. 113 * @param level The logging Level to check. 114 * @param marker A Marker or null. 115 * @param message The message. 116 * @param t the exception to log, including its stack trace. 117 */ 118 void logIfEnabled(String fqcn, Level level, Marker marker, String message, Throwable t); 119 120 /** 121 * Logs a message if the specified level is active. 122 * 123 * @param fqcn The fully qualified class name of the logger entry point, used to determine the caller class and 124 * method when location information needs to be logged. 125 * @param level The logging Level to check. 126 * @param marker A Marker or null. 127 * @param message The message. 128 */ 129 void logIfEnabled(String fqcn, Level level, Marker marker, String message); 130 131 /** 132 * Logs a message if the specified level is active. 133 * 134 * @param fqcn The fully qualified class name of the logger entry point, used to determine the caller class and 135 * method when location information needs to be logged. 136 * @param level The logging Level to check. 137 * @param marker A Marker or null. 138 * @param message The message format. 139 * @param params The message parameters. 140 */ 141 void logIfEnabled(String fqcn, Level level, Marker marker, String message, Object... params); 142 143 /** 144 * Always logs a message at the specified level. It is the responsibility of the caller to ensure the specified 145 * level is enabled. 146 * 147 * @param fqcn The fully qualified class name of the logger entry point, used to determine the caller class and 148 * method when location information needs to be logged. 149 * @param level The logging Level to check. 150 * @param marker A Marker or null. 151 * @param message The Message. 152 * @param t the exception to log, including its stack trace. 153 */ 154 void logMessage(String fqcn, Level level, Marker marker, Message message, Throwable t); 155}