Commit 1dea5281 authored by nshah's avatar nshah

Applying logging-stubs-updated-public-and-protected-aug24.patch from OCVET-213

parent c6cdc684
......@@ -34,12 +34,60 @@ import org.apache.log4j.spi.OptionHandler;
* */
public abstract class AppenderSkeleton implements Appender, OptionHandler {
/**
/**
*The layout variable does not need to be set if the appender
* implementation has its own layout.
*/
protected Layout layout;
/**
*Appenders are named.
*/
protected String name;
/**
* There is no level threshold filtering by default.
*/
protected Priority threshold;
/**
* It is assumed and enforced that errorHandler is never null.
*/
protected ErrorHandler errorHandler;
/**
*The first filter in the filter chain. Set to <code>null</code>
* initially.
*/
protected Filter headFilter;
/**
*The last filter in the filter chain.
*/
protected Filter tailFilter;
/**
* Is this appender closed?
*/
protected boolean closed;
/**
* Create new instance.
*/
public AppenderSkeleton() {
}
/**
* Create new instance.
* Provided for compatibility with log4j 1.3.
* @param isActive true if appender is ready for use upon construction.
* Not used in log4j 1.2.x.
* @since 1.2.15
*/
protected AppenderSkeleton(boolean isActive)
{
}
/**
Derived appenders should override this method if option structure
requires it. */
......@@ -56,6 +104,14 @@ public abstract class AppenderSkeleton implements Appender, OptionHandler {
public
void addFilter(Filter newFilter) {
}
/**
* Subclasses of <code>AppenderSkeleton</code> should implement this
* method to perform actual logging. See also {@link #doAppend
* AppenderSkeleton.doAppend} method.
* @since 0.9.0
*/
protected abstract void append(LoggingEvent event);
/**
Clear the filters chain.
......
......@@ -83,6 +83,50 @@ import java.util.ResourceBundle;
*/
public class Category implements AppenderAttachable {
/**
* The name of this category.
*/
protected String name;
/**
* The assigned level of this category. The
* <code>level</code> variable need not be assigned a value in
* which case it is inherited form the hierarchy.
*/
protected volatile Level level;
/**
* The parent of this category. All categories have at least one
* ancestor which is the root category.
*/
protected volatile Category parent;
// No comment
protected ResourceBundle resourceBundle;
// No comment
protected LoggerRepository repository;
/**
*Additivity is set to true by default, that is children inherit
* the appenders of their ancestors by default. If this variable is
* set to <code>false</code> then the appenders found in the
* ancestors of this category are not used. However, the children
* of this category will inherit its appenders, unless the children
* have their additivity flag set to <code>false</code> too. See
* the user manual for more details.
*/
protected boolean additive;
/**
* This constructor created a new <code>Category</code> instance and
* sets its name.
* <p>It is intended to be used by sub-classes only. You should not
* create categories directly.
* @param name The name of the category.
*/
protected Category(String name) {
}
/**
Add <code>newAppender</code> to the list of appenders of this
......@@ -259,6 +303,16 @@ public class Category implements AppenderAttachable {
}
public void setGroup(String group) {
}
/**
* This method creates a new logging event and logs the event
* without further checks.
*/
protected void forcedLog(String fqcn, Level level, Object message, Throwable t) {
}
/**
Get the additivity flag for this Category instance.
*/
......@@ -456,6 +510,17 @@ public class Category implements AppenderAttachable {
return null;
}
/**
* Returns the string resource coresponding to <code>key</code> in
* this category's inherited resource bundle. See also {@link
* #getResourceBundle}.
* <p>If the resource cannot be found, then an {@link #error error}
* message will be logged complaining about the missing resource.
*/
protected String getResourceBundleString(String key) {
return null;
}
/**
Log a message object with the {@link Level#INFO INFO} Level.
......@@ -688,7 +753,7 @@ public class Category implements AppenderAttachable {
@since 0.8.4 */
public
void l7dlog(Priority priority, String key, Throwable t) {
void l7dlog(Level level, String key, Throwable t) {
}
/**
Log a localized and parameterized message. First, the user
......@@ -700,21 +765,21 @@ public class Category implements AppenderAttachable {
@since 0.8.4
*/
public
void l7dlog(Priority priority, String key, Object[] params, Throwable t) {
void l7dlog(Level level, String key, Object[] params, Throwable t) {
}
/**
This generic form is intended to be used by wrappers.
*/
public
void log(Priority priority, Object message, Throwable t) {
void log(Level level, Object message, Throwable t) {
}
/**
This generic form is intended to be used by wrappers.
*/
public
void log(Priority priority, Object message) {
void log(Level level, Object message) {
}
/**
......@@ -727,7 +792,7 @@ public class Category implements AppenderAttachable {
@param message The message of the logging request.
@param t The throwable of the logging request, may be null. */
public
void log(String callerFQCN, Priority level, Object message, Throwable t) {
void log(String callerFQCN, Level level, Object message, Throwable t) {
}
/**
......
......@@ -29,6 +29,10 @@ import org.apache.log4j.spi.LoggingEvent;
public abstract class Layout implements OptionHandler {
public static final String LINE_SEP = null;
public static final int LINE_SEP_LEN = 0;
/**
Implement this method to create your own layout format.
*/
......@@ -42,7 +46,7 @@ public abstract class Layout implements OptionHandler {
*/
public
String getContentType() {
return "text/plain";
return null;
}
/**
......
......@@ -87,6 +87,13 @@ public class Level extends Priority implements Serializable {
turn on all logging. */
final static public Level ALL = null;
/**
* Instantiate a Level object.
*/
protected Level(int level, String levelStr, int syslogEquivalent)
{
super();
}
/**
Convert the string passed as argument to a level. If the
......
......@@ -34,6 +34,33 @@ import org.apache.log4j.spi.RepositorySelector;
* @author Ceki G&uuml;lc&uuml; */
public class LogManager {
/**
* @deprecated This variable is for internal use only. It will
* become package protected in future versions.
*
*/
public static final String DEFAULT_CONFIGURATION_FILE = "log4j.properties";
/**
* @deprecated This variable is for internal use only. It will
* become private in future versions.
*
*/
public static final String DEFAULT_CONFIGURATION_KEY = "log4j.configuration";
/**
* @deprecated This variable is for internal use only. It will
* become private in future versions.
*
*/
public static final String CONFIGURATOR_CLASS_KEY = "log4j.configuratorClass";
/**
* @deprecated This variable is for internal use only. It will
* become private in future versions.
*/
public static final String DEFAULT_INIT_OVERRIDE_KEY = "log4j.defaultInitOverride";
/**
Sets <code>LoggerFactory</code> but only if the correct
<em>guard</em> is passed as parameter.
......@@ -126,4 +153,12 @@ public class LogManager {
static
void resetConfiguration() {
}
public static Logger getLogger(String name, String group, LoggerFactory factory) {
return null;
}
public static Logger getLogger(String name, String group) {
return null;
}
}
......@@ -62,22 +62,27 @@ import org.apache.log4j.spi.LoggerFactory;
public class Logger extends Category
{
protected Logger(String name)
{
super((String)null);
}
/**
Log a message object with the {@link Level#FINE FINE} level which
is just an alias for the {@link Level#DEBUG DEBUG} level.
<p>This method first checks if this category is <code>DEBUG</code>
enabled by comparing the level of this category with the {@link
Level#DEBUG DEBUG} level. If this category is
<code>DEBUG</code> enabled, then it converts the message object
(passed as parameter) to a string by invoking the appropriate
{@link org.apache.log4j.or.ObjectRenderer}. It then proceeds to call all the
registered appenders in this category and also higher in the
hierarchy depending on the value of the additivity flag.
<p><b>WARNING</b> Note that passing a {@link Throwable} to this
method will print the name of the <code>Throwable</code> but no
stack trace. To print a stack trace use the {@link #debug(Object,
Throwable)} form instead.
@param message the message object to log. */
Log a message object with the {@link Level#FINE FINE} level which
is just an alias for the {@link Level#DEBUG DEBUG} level.
<p>This method first checks if this category is <code>DEBUG</code>
enabled by comparing the level of this category with the {@link
Level#DEBUG DEBUG} level. If this category is
<code>DEBUG</code> enabled, then it converts the message object
(passed as parameter) to a string by invoking the appropriate
{@link org.apache.log4j.or.ObjectRenderer}. It then proceeds to call all the
registered appenders in this category and also higher in the
hierarchy depending on the value of the additivity flag.
<p><b>WARNING</b> Note that passing a {@link Throwable} to this
method will print the name of the <code>Throwable</code> but no
stack trace. To print a stack trace use the {@link #debug(Object,
Throwable)} form instead.
@param message the message object to log. */
//public
//void fine(Object message) {
// if(repository.isDisabled(Level.DEBUG_INT))
......
......@@ -60,6 +60,19 @@ public class Priority {
*/
final static public Priority DEBUG = null;
/**
* Default constructor for deserialization.
*/
protected Priority()
{
}
/**
* Instantiate a level object.
*/
protected Priority(int level, String levelStr, int syslogEquivalent)
{
}
/**
Two priorities are equal if their level fields are equal.
......
......@@ -78,6 +78,10 @@ import org.apache.log4j.spi.LoggerRepository;
@since 0.8.1 */
public class PropertyConfigurator implements Configurator {
/** Key for specifying the {@link org.apache.log4j.spi.LoggerFactory
LoggerFactory}. Currently set to "<code>log4j.loggerFactory</code>". */
public static final String LOGGER_FACTORY_KEY = "log4j.loggerFactory";
/**
Read configuration from a file. <b>The existing configuration is
not cleared nor reset.</b> If you require a different behavior,
......
......@@ -111,14 +111,13 @@ public abstract class Filter implements OptionHandler {
* Set the next filter pointer.
*/
public void setNext(Filter next) {
this.next = next;
}
/**
* Return the pointer to the next filter;
*/
public Filter getNext() {
return next;
return null;
}
}
......@@ -26,6 +26,25 @@ package org.apache.log4j.spi;
*/
public class LocationInfo implements java.io.Serializable {
/**
* All available caller information, in the format
* <code>fully.qualified.classname.of.caller.methodName(Filename.java:line)</code>
*/
public String fullInfo;
/**
* When location information is not available the constant
* <code>NA</code> is returned. Current value of this string
* constant is <b>?</b>.
*/
public static final String NA = "?";
/**
* NA_LOCATION_INFO is provided for compatibility with log4j 1.3.
* @since 1.2.15
*/
public static final LocationInfo NA_LOCATION_INFO = null;
/**
Instantiate location information based on a Throwable. We
expect the Throwable <code>t</code>, to be in the format
......
......@@ -79,6 +79,8 @@ public interface LoggerRepository {
public
Logger getLogger(String name, LoggerFactory factory);
public Logger getLogger(String name, String group, LoggerFactory factory);
public
Logger getRootLogger();
......@@ -107,4 +109,7 @@ public interface LoggerRepository {
abstract
void resetConfiguration();
public Logger getLogger(String name, String group);
public void setGroup(String groupName, Level groupThreshold);
}
......@@ -42,6 +42,41 @@ import org.apache.log4j.Priority;
@since 0.8.2 */
public class LoggingEvent implements java.io.Serializable {
/**
*Fully qualified name of the calling category class.
*/
public final transient String fqnOfCategoryClass = null;
/**
* <p>The category (logger) name.
*
* @deprecated This field will be marked as private in future
* releases. Please do not access it directly. Use the {@link
* #getLoggerName} method instead.
*
*/
public final String categoryName = null;
/**
* Level of logging event. Level cannot be serializable because it
* is a flyweight. Due to its special seralization it cannot be
* declared final either.
*
* <p> This field should not be accessed directly. You shoud use the
* {@link #getLevel} method instead.
* @deprecated This field will be marked as private in future
* releases. Please do not access it directly. Use the {@link
* #getLevel} method instead.
*
*/
public transient Priority level;
/**
*The number of milliseconds elapsed from 1/1/1970 until logging event
* was created.
*/
public final long timeStamp = 0L;
/**
Instantiate a LoggingEvent from the supplied parameters.
......
......@@ -252,14 +252,4 @@ public class DOMConfigurator implements Configurator {
final Class expectedClass) throws Exception {
return null;
}
/**
Call {@link DOMConfigurator#configure(String)} with the
<code>filename</code> to reconfigure log4j.
@throws SecurityException if the caller does not have
MonitorAppPermission("logger.config").
*/
public
void doOnChange() {
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment