Categories:
Audio (13)
Biotech (29)
Bytecode (36)
Database (77)
Framework (7)
Game (7)
General (507)
Graphics (53)
I/O (35)
IDE (2)
JAR Tools (101)
JavaBeans (21)
JDBC (121)
JDK (426)
JSP (20)
Logging (108)
Mail (58)
Messaging (8)
Network (84)
PDF (97)
Report (7)
Scripting (84)
Security (32)
Server (121)
Servlet (26)
SOAP (24)
Testing (54)
Web (15)
XML (309)
Collections:
Other Resources:
commons-logging-1.2-src.zip - Apache Commons Logging
commons-logging-1.2-src.zip is the source ZIP file for Apache Commons Logging 1.2, which is an ultra-thin bridge between different logging implementations. A library that uses the commons-logging API can be used with any logging implementation at runtime.
ZIP File Size and Download Location:
JAR name: commons-logging-1.2-src.zip Target JDK version: 1.2 Dependency: None File size: 293,884 bytes) Date modified: 05-Jul-2014 Download: Apache Commons Logging
✍: FYIcenter.com
⏎ org/apache/commons/logging/impl/LogKitLogger.java
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You 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. */ package org.apache.commons.logging.impl; import java.io.Serializable; import org.apache.log.Logger; import org.apache.log.Hierarchy; import org.apache.commons.logging.Log; /** * Implementation of <code>org.apache.commons.logging.Log</code> * that wraps the <a href="http://avalon.apache.org/logkit/">avalon-logkit</a> * logging system. Configuration of <code>LogKit</code> is left to the user. * <p> * <code>LogKit</code> accepts only <code>String</code> messages. * Therefore, this implementation converts object messages into strings * by called their <code>toString()</code> method before logging them. * * @version $Id: LogKitLogger.java 1448119 2013-02-20 12:28:04Z tn $ */ public class LogKitLogger implements Log, Serializable { /** Serializable version identifier. */ private static final long serialVersionUID = 3768538055836059519L; // ------------------------------------------------------------- Attributes /** Logging goes to this <code>LogKit</code> logger */ protected transient volatile Logger logger = null; /** Name of this logger */ protected String name = null; // ------------------------------------------------------------ Constructor /** * Construct <code>LogKitLogger</code> which wraps the <code>LogKit</code> * logger with given name. * * @param name log name */ public LogKitLogger(String name) { this.name = name; this.logger = getLogger(); } // --------------------------------------------------------- Public Methods /** * Return the underlying Logger we are using. */ public Logger getLogger() { Logger result = logger; if (result == null) { synchronized(this) { result = logger; if (result == null) { logger = result = Hierarchy.getDefaultHierarchy().getLoggerFor(name); } } } return result; } // ----------------------------------------------------- Log Implementation /** * Logs a message with <code>org.apache.log.Priority.DEBUG</code>. * * @param message to log * @see org.apache.commons.logging.Log#trace(Object) */ public void trace(Object message) { debug(message); } /** * Logs a message with <code>org.apache.log.Priority.DEBUG</code>. * * @param message to log * @param t log this cause * @see org.apache.commons.logging.Log#trace(Object, Throwable) */ public void trace(Object message, Throwable t) { debug(message, t); } /** * Logs a message with <code>org.apache.log.Priority.DEBUG</code>. * * @param message to log * @see org.apache.commons.logging.Log#debug(Object) */ public void debug(Object message) { if (message != null) { getLogger().debug(String.valueOf(message)); } } /** * Logs a message with <code>org.apache.log.Priority.DEBUG</code>. * * @param message to log * @param t log this cause * @see org.apache.commons.logging.Log#debug(Object, Throwable) */ public void debug(Object message, Throwable t) { if (message != null) { getLogger().debug(String.valueOf(message), t); } } /** * Logs a message with <code>org.apache.log.Priority.INFO</code>. * * @param message to log * @see org.apache.commons.logging.Log#info(Object) */ public void info(Object message) { if (message != null) { getLogger().info(String.valueOf(message)); } } /** * Logs a message with <code>org.apache.log.Priority.INFO</code>. * * @param message to log * @param t log this cause * @see org.apache.commons.logging.Log#info(Object, Throwable) */ public void info(Object message, Throwable t) { if (message != null) { getLogger().info(String.valueOf(message), t); } } /** * Logs a message with <code>org.apache.log.Priority.WARN</code>. * * @param message to log * @see org.apache.commons.logging.Log#warn(Object) */ public void warn(Object message) { if (message != null) { getLogger().warn(String.valueOf(message)); } } /** * Logs a message with <code>org.apache.log.Priority.WARN</code>. * * @param message to log * @param t log this cause * @see org.apache.commons.logging.Log#warn(Object, Throwable) */ public void warn(Object message, Throwable t) { if (message != null) { getLogger().warn(String.valueOf(message), t); } } /** * Logs a message with <code>org.apache.log.Priority.ERROR</code>. * * @param message to log * @see org.apache.commons.logging.Log#error(Object) */ public void error(Object message) { if (message != null) { getLogger().error(String.valueOf(message)); } } /** * Logs a message with <code>org.apache.log.Priority.ERROR</code>. * * @param message to log * @param t log this cause * @see org.apache.commons.logging.Log#error(Object, Throwable) */ public void error(Object message, Throwable t) { if (message != null) { getLogger().error(String.valueOf(message), t); } } /** * Logs a message with <code>org.apache.log.Priority.FATAL_ERROR</code>. * * @param message to log * @see org.apache.commons.logging.Log#fatal(Object) */ public void fatal(Object message) { if (message != null) { getLogger().fatalError(String.valueOf(message)); } } /** * Logs a message with <code>org.apache.log.Priority.FATAL_ERROR</code>. * * @param message to log * @param t log this cause * @see org.apache.commons.logging.Log#fatal(Object, Throwable) */ public void fatal(Object message, Throwable t) { if (message != null) { getLogger().fatalError(String.valueOf(message), t); } } /** * Checks whether the <code>LogKit</code> logger will log messages of priority <code>DEBUG</code>. */ public boolean isDebugEnabled() { return getLogger().isDebugEnabled(); } /** * Checks whether the <code>LogKit</code> logger will log messages of priority <code>ERROR</code>. */ public boolean isErrorEnabled() { return getLogger().isErrorEnabled(); } /** * Checks whether the <code>LogKit</code> logger will log messages of priority <code>FATAL_ERROR</code>. */ public boolean isFatalEnabled() { return getLogger().isFatalErrorEnabled(); } /** * Checks whether the <code>LogKit</code> logger will log messages of priority <code>INFO</code>. */ public boolean isInfoEnabled() { return getLogger().isInfoEnabled(); } /** * Checks whether the <code>LogKit</code> logger will log messages of priority <code>DEBUG</code>. */ public boolean isTraceEnabled() { return getLogger().isDebugEnabled(); } /** * Checks whether the <code>LogKit</code> logger will log messages of priority <code>WARN</code>. */ public boolean isWarnEnabled() { return getLogger().isWarnEnabled(); } }
⏎ org/apache/commons/logging/impl/LogKitLogger.java
Or download all of them as a single archive file:
File name: commons-logging-1.2-sources.zip File size: 68497 bytes Release date: 2014-07-05 Download
⇒ What Is commons-logging-1.1.3.jar?
⇐ What Is commons-logging-1.2.jar?
2018-10-25, 10067👍, 0💬
Popular Posts:
Apache Axis2 is the core engine for Web services. It is a complete re-design and re-write of the wid...
commons-lang-1.0.1.jar is the JAR file for Apache Commons Lang 1.0.1, which provides a host of helpe...
SLF4J API is a simple API that allows to plug in any desired logging library at deployment time. Her...
JDK 6 tools.jar is the JAR file for JDK 6 tools. It contains Java classes to support different JDK t...
Apache Ant Source Code Files are inside the Apache Ant source package file like apache-ant-1.10.10-s...