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.test.mock.avalon;
019:
020: import org.apache.avalon.framework.logger.Logger;
021:
022: public class MockLogger implements Logger {
023: private boolean m_debugEnabled = true;
024:
025: public void debug(java.lang.String string) {
026: System.out.println(string);
027: }
028:
029: public void debug(java.lang.String string,
030: java.lang.Throwable throwable) {
031: System.out.println(string + throwable.toString());
032: throwable.printStackTrace();
033: }
034:
035: public boolean isDebugEnabled() {
036: return m_debugEnabled;
037: }
038:
039: public void disableDebug() {
040: m_debugEnabled = false;
041: }
042:
043: public void info(java.lang.String string) {
044: System.out.println(string);
045: }
046:
047: public void info(java.lang.String string,
048: java.lang.Throwable throwable) {
049: System.out.println(string + throwable.toString());
050: throwable.printStackTrace();
051: }
052:
053: public boolean isInfoEnabled() {
054: return true;
055: }
056:
057: public void warn(java.lang.String string) {
058: System.out.println(string);
059: }
060:
061: public void warn(java.lang.String string,
062: java.lang.Throwable throwable) {
063: System.out.println(string + throwable.toString());
064: throwable.printStackTrace();
065: }
066:
067: public boolean isWarnEnabled() {
068: return true;
069: }
070:
071: public void error(java.lang.String string) {
072: System.out.println(string);
073: }
074:
075: public void error(java.lang.String string,
076: java.lang.Throwable throwable) {
077: System.out.println(string + throwable.toString());
078: throwable.printStackTrace();
079: }
080:
081: public boolean isErrorEnabled() {
082: return true;
083: }
084:
085: public void fatalError(java.lang.String string) {
086: System.out.println(string);
087: }
088:
089: public void fatalError(java.lang.String string,
090: java.lang.Throwable throwable) {
091: System.out.println(string + throwable.toString());
092: throwable.printStackTrace();
093: }
094:
095: public boolean isFatalErrorEnabled() {
096: return true;
097: }
098:
099: public org.apache.avalon.framework.logger.Logger getChildLogger(
100: java.lang.String string) {
101: return this;
102: }
103:
104: }
|