1 19 20 package org.apache.james.test.mock.avalon; 21 22 import org.apache.avalon.framework.logger.Logger; 23 24 public class MockLogger implements Logger { 25 private boolean m_debugEnabled = true; 26 27 public void debug(java.lang.String string) { 28 System.out.println(string); 29 } 30 31 public void debug(java.lang.String string, java.lang.Throwable throwable) { 32 System.out.println(string + throwable.toString()); 33 throwable.printStackTrace(); 34 } 35 36 public boolean isDebugEnabled() { 37 return m_debugEnabled; 38 } 39 40 public void disableDebug() { 41 m_debugEnabled = false; 42 } 43 44 public void info(java.lang.String string) { 45 System.out.println(string); 46 } 47 48 public void info(java.lang.String string, java.lang.Throwable throwable) { 49 System.out.println(string + throwable.toString()); 50 throwable.printStackTrace(); 51 } 52 53 public boolean isInfoEnabled() { 54 return true; 55 } 56 57 public void warn(java.lang.String string) { 58 System.out.println(string); 59 } 60 61 public void warn(java.lang.String string, java.lang.Throwable throwable) { 62 System.out.println(string + throwable.toString()); 63 throwable.printStackTrace(); 64 } 65 66 public boolean isWarnEnabled() { 67 return true; 68 } 69 70 public void error(java.lang.String string) { 71 System.out.println(string); 72 } 73 74 public void error(java.lang.String string, java.lang.Throwable throwable) { 75 System.out.println(string + throwable.toString()); 76 throwable.printStackTrace(); 77 } 78 79 public boolean isErrorEnabled() { 80 return true; 81 } 82 83 public void fatalError(java.lang.String string) { 84 System.out.println(string); 85 } 86 87 public void fatalError(java.lang.String string, java.lang.Throwable throwable) { 88 System.out.println(string + throwable.toString()); 89 throwable.printStackTrace(); 90 } 91 92 public boolean isFatalErrorEnabled() { 93 return true; 94 } 95 96 public org.apache.avalon.framework.logger.Logger getChildLogger(java.lang.String string) { 97 return this; 98 } 99 100 } 101 | Popular Tags |