001: /* ====================================================================
002: * The Apache Software License, Version 1.1
003: *
004: * Copyright (c) 1997-2003 The Apache Software Foundation. All rights
005: * reserved.
006: *
007: * Redistribution and use in source and binary forms, with or without
008: * modification, are permitted provided that the following conditions
009: * are met:
010: *
011: * 1. Redistributions of source code must retain the above copyright
012: * notice, this list of conditions and the following disclaimer.
013: *
014: * 2. Redistributions in binary form must reproduce the above copyright
015: * notice, this list of conditions and the following disclaimer in
016: * the documentation and/or other materials provided with the
017: * distribution.
018: *
019: * 3. The end-user documentation included with the redistribution,
020: * if any, must include the following acknowledgment:
021: * "This product includes software developed by the
022: * Apache Software Foundation (http://www.apache.org/)."
023: * Alternately, this acknowledgment may appear in the software
024: * itself, if and wherever such third-party acknowledgments
025: * normally appear.
026: *
027: * 4. The names "Jakarta", "Avalon", and "Apache Software Foundation"
028: * must not be used to endorse or promote products derived from this
029: * software without prior written permission. For written
030: * permission, please contact apache@apache.org.
031: *
032: * 5. Products derived from this software may not be called "Apache",
033: * nor may "Apache" appear in their name, without prior written
034: * permission of the Apache Software Foundation.
035: *
036: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
037: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
038: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
039: * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
040: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
041: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
042: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
043: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
044: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
045: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
046: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
047: * SUCH DAMAGE.
048: * ====================================================================
049: *
050: * This software consists of voluntary contributions made by many
051: * individuals on behalf of the Apache Software Foundation. For more
052: * information on the Apache Software Foundation, please see
053: * <http://www.apache.org/>.
054: */
055: package org.apache.log;
056:
057: /**
058: * The LogKit provides the access to static methods to
059: * manipulate the logging sub-system
060: *
061: * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
062: * @deprecated Instead of using LogKit directly use the facilities in code itself
063: */
064: public final class LogKit {
065: /**
066: * Get the Current ContextStack.
067: * This returns a ContextStack associated with current thread. If the
068: * thread doesn't have a ContextStack associated with it then a new
069: * ContextStack is created with the name of thread as base context.
070: *
071: * @return the current ContextStack
072: * @deprecated Use ContextStack.getCurrentContext() instead
073: */
074: public static ContextStack getCurrentContext() {
075: return ContextStack.getCurrentContext();
076: }
077:
078: /**
079: * Retrieve a logger for named category.
080: *
081: * @param category the context
082: * @return the Logger
083: * @deprecated Use Hierarchy.getDefaultHierarchy().getLoggerFor() instead
084: */
085: public static Logger getLoggerFor(final String category) {
086: return Hierarchy.getDefaultHierarchy().getLoggerFor(category);
087: }
088:
089: /**
090: * Retrieve a Priority value for the string parameter.
091: *
092: * @param priority the priority
093: * @return the descriptive string
094: * @deprecated Use Priority.getPriorityForName() instead
095: */
096: public static Priority getPriorityForName(final String priority) {
097: return Priority.getPriorityForName(priority);
098: }
099:
100: /**
101: * Logs an error message to error handler.
102: *
103: * @deprecated Use Hierarchy.getDefaultHierarchy().log() instead
104: */
105: public static void log(final String message, final Throwable t) {
106: Hierarchy.getDefaultHierarchy().log(message, t);
107: }
108:
109: /**
110: * Logs an error message to error handler.
111: *
112: * @deprecated Use Hierarchy.getDefaultHierarchy().log() instead
113: */
114: public static void log(final String message) {
115: Hierarchy.getDefaultHierarchy().log(message);
116: }
117:
118: /**
119: * Sets the default LogTarget for the default logger.
120: *
121: * @deprecated Use Hierarchy.getDefaultHierarchy().setDefaultLogTarget() instead
122: */
123: public static void setDefaultLogTarget(
124: final LogTarget defaultLogTarget) {
125: Hierarchy.getDefaultHierarchy().setDefaultLogTarget(
126: defaultLogTarget);
127: }
128:
129: /**
130: * Constructor hidden to prevent instantiation of this static object
131: */
132: private LogKit() {
133: }
134: }
|