001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one
003: * or more contributor license agreements. See the NOTICE file
004: * distributed with this work for additional information
005: * regarding copyright ownership. The ASF licenses this file
006: * to you under the Apache License, Version 2.0 (the
007: * "License"); you may not use this file except in compliance
008: * with the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing,
013: * software distributed under the License is distributed on an
014: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015: * KIND, either express or implied. See the License for the
016: * specific language governing permissions and limitations
017: * under the License.
018: */
019: package org.apache.openjpa.lib.log;
020:
021: /**
022: * Logging interface that is independent of other logging frameworks.
023: *
024: * @author Patrick Linskey
025: * @author Abe White
026: */
027: public interface Log {
028:
029: public static final short TRACE = 1;
030: // the old DEBUG constant was 2. Leaving a hole for compatibility.
031: public static final short INFO = 3;
032: public static final short WARN = 4;
033: public static final short ERROR = 5;
034: public static final short FATAL = 6;
035:
036: /**
037: * Returns if the {@link #TRACE} log level is enabled.
038: */
039: public boolean isTraceEnabled();
040:
041: /**
042: * Returns if the {@link #INFO} log level is enabled.
043: */
044: public boolean isInfoEnabled();
045:
046: /**
047: * Returns if the {@link #WARN} log level is enabled.
048: */
049: public boolean isWarnEnabled();
050:
051: /**
052: * Returns if the {@link #ERROR} log level is enabled.
053: */
054: public boolean isErrorEnabled();
055:
056: /**
057: * Returns if the {@link #FATAL} log level is enabled.
058: */
059: public boolean isFatalEnabled();
060:
061: /**
062: * Write out a log message at the {@link #TRACE}
063: * level with the stringification of <code>o</code> as the body
064: * of the message.
065: */
066: public void trace(Object o);
067:
068: /**
069: * Write out a log message at the {@link #TRACE}
070: * level with the stringification of <code>o</code> as the body
071: * of the message, also outputting <code>t</code> to the log.
072: */
073: public void trace(Object o, Throwable t);
074:
075: /**
076: * Write out a log message at the {@link #INFO}
077: * level with the stringification of <code>o</code> as the body
078: * of the message, also outputting <code>t</code> to the log.
079: */
080: public void info(Object o);
081:
082: /**
083: * Write out a log message at the {@link #INFO}
084: * level with the stringification of <code>o</code> as the body
085: * of the message, also outputting <code>t</code> to the log.
086: */
087: public void info(Object o, Throwable t);
088:
089: /**
090: * Write out a log message at the {@link #WARN}
091: * level with the stringification of <code>o</code> as the body
092: * of the message, also outputting <code>t</code> to the log.
093: */
094: public void warn(Object o);
095:
096: /**
097: * Write out a log message at the {@link #WARN}
098: * level with the stringification of <code>o</code> as the body
099: * of the message, also outputting <code>t</code> to the log.
100: */
101: public void warn(Object o, Throwable t);
102:
103: /**
104: * Write out a log message at the {@link #ERROR}
105: * level with the stringification of <code>o</code> as the body
106: * of the message, also outputting <code>t</code> to the log.
107: */
108: public void error(Object o);
109:
110: /**
111: * Write out a log message at the {@link #ERROR}
112: * level with the stringification of <code>o</code> as the body
113: * of the message, also outputting <code>t</code> to the log.
114: */
115: public void error(Object o, Throwable t);
116:
117: /**
118: * Write out a log message at the {@link #FATAL}
119: * level with the stringification of <code>o</code> as the body
120: * of the message, also outputting <code>t</code> to the log.
121: */
122: public void fatal(Object o);
123:
124: /**
125: * Write out a log message at the {@link #FATAL}
126: * level with the stringification of <code>o</code> as the body
127: * of the message, also outputting <code>t</code> to the log.
128: */
129: public void fatal(Object o, Throwable t);
130: }
|