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