A simple logging interface abstracting logging APIs. In order to be instantiated successfully by com.good.gd.apache.commons.logging.LogFactory, classes that implement this interface must have a constructor that takes a single String parameter representing the "name" of this Log.
The six logging levels used by Log
are (in order):
The mapping of these log levels to the concepts used by the underlying logging system is implementation dependent. The implemention should ensure, though, that this ordering behaves as expected.
Performance is often a logging concern. By examining the appropriate property, a component can avoid expensive operations (producing information to be logged).
For example,
if (log.isDebugEnabled()) { ... do something expensive ... log.debug(theResult); }
Configuration of the underlying logging system will generally be done external to the Logging APIs, through whatever mechanism is supported by that system.
The following notice applies to the original API on which this API is based, and to its documentation. The documentation of this API has been revised from the original.
/* * Copyright (C) 2006 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */
Public Member Functions | |
boolean | isDebugEnabled () |
boolean | isErrorEnabled () |
boolean | isFatalEnabled () |
boolean | isInfoEnabled () |
boolean | isTraceEnabled () |
boolean | isWarnEnabled () |
void | trace (Object message) |
void | trace (Object message, Throwable t) |
void | debug (Object message) |
void | debug (Object message, Throwable t) |
void | info (Object message) |
void | info (Object message, Throwable t) |
void | warn (Object message) |
void | warn (Object message, Throwable t) |
void | error (Object message) |
void | error (Object message, Throwable t) |
void | fatal (Object message) |
void | fatal (Object message, Throwable t) |
boolean isDebugEnabled | ( | ) |
Is debug logging currently enabled?
Call this method to prevent having to perform expensive operations (for example, String
concatenation) when the log level is more than debug.
Implemented in SimpleLog, and Jdk14Logger.
boolean isErrorEnabled | ( | ) |
Is error logging currently enabled?
Call this method to prevent having to perform expensive operations (for example, String
concatenation) when the log level is more than error.
Implemented in SimpleLog, and Jdk14Logger.
boolean isFatalEnabled | ( | ) |
Is fatal logging currently enabled?
Call this method to prevent having to perform expensive operations (for example, String
concatenation) when the log level is more than fatal.
Implemented in SimpleLog, and Jdk14Logger.
boolean isInfoEnabled | ( | ) |
Is info logging currently enabled?
Call this method to prevent having to perform expensive operations (for example, String
concatenation) when the log level is more than info.
Implemented in SimpleLog, and Jdk14Logger.
boolean isTraceEnabled | ( | ) |
Is trace logging currently enabled?
Call this method to prevent having to perform expensive operations (for example, String
concatenation) when the log level is more than trace.
Implemented in SimpleLog, and Jdk14Logger.
boolean isWarnEnabled | ( | ) |
Is warn logging currently enabled?
Call this method to prevent having to perform expensive operations (for example, String
concatenation) when the log level is more than warn.
Implemented in SimpleLog, and Jdk14Logger.
void trace | ( | Object | message | ) |
Log a message with trace log level.
message | log this message |
Implemented in SimpleLog, and Jdk14Logger.
void trace | ( | Object | message, |
Throwable | t | ||
) |
Log an error with trace log level.
message | log this message |
t | log this cause |
Implemented in SimpleLog, and Jdk14Logger.
void debug | ( | Object | message | ) |
Log a message with debug log level.
message | log this message |
Implemented in SimpleLog, and Jdk14Logger.
void debug | ( | Object | message, |
Throwable | t | ||
) |
Log an error with debug log level.
message | log this message |
t | log this cause |
Implemented in SimpleLog, and Jdk14Logger.
void info | ( | Object | message | ) |
Log a message with info log level.
message | log this message |
Implemented in SimpleLog, and Jdk14Logger.
void info | ( | Object | message, |
Throwable | t | ||
) |
Log an error with info log level.
message | log this message |
t | log this cause |
Implemented in SimpleLog, and Jdk14Logger.
void warn | ( | Object | message | ) |
Log a message with warn log level.
message | log this message |
Implemented in SimpleLog, and Jdk14Logger.
void warn | ( | Object | message, |
Throwable | t | ||
) |
Log an error with warn log level.
message | log this message |
t | log this cause |
Implemented in SimpleLog, and Jdk14Logger.
void error | ( | Object | message | ) |
Log a message with error log level.
message | log this message |
Implemented in SimpleLog, and Jdk14Logger.
void error | ( | Object | message, |
Throwable | t | ||
) |
Log an error with error log level.
message | log this message |
t | log this cause |
Implemented in SimpleLog, and Jdk14Logger.
void fatal | ( | Object | message | ) |
Log a message with fatal log level.
message | log this message |
Implemented in SimpleLog, and Jdk14Logger.
void fatal | ( | Object | message, |
Throwable | t | ||
) |
Log an error with fatal log level.
message | log this message |
t | log this cause |
Implemented in SimpleLog, and Jdk14Logger.