00001 /* 00002 * OpenMobileIS - a free Java(TM) Framework for mobile applications Java(TM) 00003 * Copyright (C) 2004-2006 Philippe Delrieu 00004 * All rights reserved. 00005 * Contact: pdelrieu@openmobileis.org 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or any later version. 00011 * 00012 * This library is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 * Lesser General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU Lesser General Public 00018 * License along with this library; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00020 * USA 00021 * 00022 * Author : Philippe Delrieu 00023 * 00024 * Modifications : 00025 * Creation P.Delrieu 00026 * 00027 */ 00028 package org.openmobileis.common.util.log; 00029 00030 import org.apache.commons.logging.Log; 00031 00036 public final class ApacheSimpleLog implements Log { 00037 public static boolean loggingEnable = false; 00038 00039 public static void enableLogging() { 00040 System.setProperty("org.apache.commons.logging.Log", "org.openmobileis.common.util.log.ApacheSimpleLog"); 00041 loggingEnable = true; 00042 } 00046 public ApacheSimpleLog(String name) { 00047 } 00048 00049 /* (non-Javadoc) 00050 * @see org.apache.commons.logging.Log#debug(java.lang.Object) 00051 */ 00052 public void debug(Object arg0) { 00053 // LogManager.traceDebug(0, arg0); 00054 } 00055 00056 /* (non-Javadoc) 00057 * @see org.apache.commons.logging.Log#debug(java.lang.Object, java.lang.Throwable) 00058 */ 00059 public void debug(Object arg0, Throwable arg1) { 00060 // LogManager.traceDebug(0, arg0); 00061 // LogManager.traceDebug(0, arg1); 00062 00063 } 00064 00065 /* (non-Javadoc) 00066 * @see org.apache.commons.logging.Log#error(java.lang.Object) 00067 */ 00068 public void error(Object arg0) { 00069 // LogManager.traceError(0, arg0); 00070 } 00071 00072 /* (non-Javadoc) 00073 * @see org.apache.commons.logging.Log#error(java.lang.Object, java.lang.Throwable) 00074 */ 00075 public void error(Object arg0, Throwable arg1) { 00076 // LogManager.traceError(0, arg0); 00077 // LogManager.traceError(0, arg1); 00078 } 00079 00080 /* (non-Javadoc) 00081 * @see org.apache.commons.logging.Log#fatal(java.lang.Object) 00082 */ 00083 public void fatal(Object arg0) { 00084 // LogManager.traceCritique(0, arg0); 00085 } 00086 00087 /* (non-Javadoc) 00088 * @see org.apache.commons.logging.Log#fatal(java.lang.Object, java.lang.Throwable) 00089 */ 00090 public void fatal(Object arg0, Throwable arg1) { 00091 // LogManager.traceCritique(0, arg0); 00092 // LogManager.traceCritique(0, arg1); 00093 } 00094 00095 /* (non-Javadoc) 00096 * @see org.apache.commons.logging.Log#info(java.lang.Object) 00097 */ 00098 public void info(Object arg0) { 00099 // LogManager.traceInfo(0, arg0); 00100 } 00101 00102 /* (non-Javadoc) 00103 * @see org.apache.commons.logging.Log#info(java.lang.Object, java.lang.Throwable) 00104 */ 00105 public void info(Object arg0, Throwable arg1) { 00106 // LogManager.traceInfo(0, arg0); 00107 // LogManager.traceInfo(0, arg1); 00108 } 00109 00110 /* (non-Javadoc) 00111 * @see org.apache.commons.logging.Log#isDebugEnabled() 00112 */ 00113 public boolean isDebugEnabled() { 00114 return false; 00115 } 00116 00117 /* (non-Javadoc) 00118 * @see org.apache.commons.logging.Log#isErrorEnabled() 00119 */ 00120 public boolean isErrorEnabled() { 00121 return false; 00122 } 00123 00124 /* (non-Javadoc) 00125 * @see org.apache.commons.logging.Log#isFatalEnabled() 00126 */ 00127 public boolean isFatalEnabled() { 00128 return false; 00129 } 00130 00131 /* (non-Javadoc) 00132 * @see org.apache.commons.logging.Log#isInfoEnabled() 00133 */ 00134 public boolean isInfoEnabled() { 00135 return false; 00136 } 00137 00138 /* (non-Javadoc) 00139 * @see org.apache.commons.logging.Log#isTraceEnabled() 00140 */ 00141 public boolean isTraceEnabled() { 00142 // TODO Auto-generated method stub 00143 return false; 00144 } 00145 00146 /* (non-Javadoc) 00147 * @see org.apache.commons.logging.Log#isWarnEnabled() 00148 */ 00149 public boolean isWarnEnabled() { 00150 return false; 00151 } 00152 00153 /* (non-Javadoc) 00154 * @see org.apache.commons.logging.Log#trace(java.lang.Object) 00155 */ 00156 public void trace(Object arg0) { 00157 // LogManager.traceError(0, arg0); 00158 } 00159 00160 /* (non-Javadoc) 00161 * @see org.apache.commons.logging.Log#trace(java.lang.Object, java.lang.Throwable) 00162 */ 00163 public void trace(Object arg0, Throwable arg1) { 00164 // LogManager.traceError(0, arg0); 00165 // LogManager.traceError(0, arg1); 00166 } 00167 00168 /* (non-Javadoc) 00169 * @see org.apache.commons.logging.Log#warn(java.lang.Object) 00170 */ 00171 public void warn(Object arg0) { 00172 // LogManager.traceWarning(0, arg0); 00173 } 00174 00175 /* (non-Javadoc) 00176 * @see org.apache.commons.logging.Log#warn(java.lang.Object, java.lang.Throwable) 00177 */ 00178 public void warn(Object arg0, Throwable arg1) { 00179 // LogManager.traceWarning(0, arg0); 00180 // LogManager.traceWarning(0, arg1); 00181 } 00182 00183 }