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    
020    package org.apache.james.jspf.core;
021    
022    /**
023     * This is a facade for the different logging subsystems. It offers a simplified
024     * interface that follows IOC patterns and a simplified priority/level/severity
025     * abstraction.
026     */
027    public interface Logger {
028        /**
029         * Log a debug message.
030         * 
031         * @param message
032         *            the message
033         */
034        public void debug(String message);
035    
036        /**
037         * Log a debug message.
038         * 
039         * @param message
040         *            the message
041         * @param throwable
042         *            the throwable
043         */
044        public void debug(String message, Throwable throwable);
045    
046        /**
047         * Determine if messages of priority "debug" will be logged.
048         * 
049         * @return true if "debug" messages will be logged
050         */
051        public boolean isDebugEnabled();
052    
053        /**
054         * Log a info message.
055         * 
056         * @param message
057         *            the message
058         */
059        public void info(String message);
060    
061        /**
062         * Log a info message.
063         * 
064         * @param message
065         *            the message
066         * @param throwable
067         *            the throwable
068         */
069        public void info(String message, Throwable throwable);
070    
071        /**
072         * Determine if messages of priority "info" will be logged.
073         * 
074         * @return true if "info" messages will be logged
075         */
076        public boolean isInfoEnabled();
077    
078        /**
079         * Log a warn message.
080         * 
081         * @param message
082         *            the message
083         */
084        public void warn(String message);
085    
086        /**
087         * Log a warn message.
088         * 
089         * @param message
090         *            the message
091         * @param throwable
092         *            the throwable
093         */
094        public void warn(String message, Throwable throwable);
095    
096        /**
097         * Determine if messages of priority "warn" will be logged.
098         * 
099         * @return true if "warn" messages will be logged
100         */
101        public boolean isWarnEnabled();
102    
103        /**
104         * Log a error message.
105         * 
106         * @param message
107         *            the message
108         */
109        public void error(String message);
110    
111        /**
112         * Log a error message.
113         * 
114         * @param message
115         *            the message
116         * @param throwable
117         *            the throwable
118         */
119        public void error(String message, Throwable throwable);
120    
121        /**
122         * Determine if messages of priority "error" will be logged.
123         * 
124         * @return true if "error" messages will be logged
125         */
126        public boolean isErrorEnabled();
127    
128        /**
129         * Log a fatalError message.
130         * 
131         * @param message
132         *            the message
133         */
134        public void fatalError(String message);
135    
136        /**
137         * Log a fatalError message.
138         * 
139         * @param message
140         *            the message
141         * @param throwable
142         *            the throwable
143         */
144        public void fatalError(String message, Throwable throwable);
145    
146        /**
147         * Determine if messages of priority "fatalError" will be logged.
148         * 
149         * @return true if "fatalError" messages will be logged
150         */
151        public boolean isFatalErrorEnabled();
152    
153        /**
154         * Create a new child logger. The name of the child logger is
155         * [current-loggers-name].[passed-in-name] Throws
156         * <code>IllegalArgumentException</code> if name has an empty element name
157         * 
158         * @param name
159         *            the subname of this logger
160         * @return the new logger
161         */
162        public Logger getChildLogger(String name);
163    }