tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@locus.apache.org
Subject cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/core ContextManager.java
Date Thu, 22 Jun 2000 23:33:14 GMT
alex        00/06/22 16:33:13

  Modified:    src/share/org/apache/tomcat/core ContextManager.java
  Log:
  Use new LogHelper instead of idiosyncratic, inconsistent log behavior
  
  I'd like to kill addLogger() -- any objections?
  
  Fixed bug: doLog() method forcibly set tc_log to CustomOutput and
  INFORMATION, overriding servlet.xml
  
  Revision  Changes    Path
  1.96      +10 -21    jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java
  
  Index: ContextManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/core/ContextManager.java,v
  retrieving revision 1.95
  retrieving revision 1.96
  diff -u -r1.95 -r1.96
  --- ContextManager.java	2000/06/22 19:49:34	1.95
  +++ ContextManager.java	2000/06/22 23:33:11	1.96
  @@ -1124,9 +1124,10 @@
   
       // -------------------- Logging and debug --------------------
       boolean firstLog = true;
  -    Logger cmLog = null;
  +    LogHelper loghelper = new LogHelper("tc_log", "ContextManager");
       
  -
  +    // Not used, except in server.xml, and usage is unclear -- should
  +    // we kill it? Looks very obsolete.
       public void addLogger(Logger l) {
   	// Will use this later once I feel more sure what I want to do here.
   	// -akv
  @@ -1156,35 +1157,23 @@
       }
       
       public final void log(String msg) {
  -	doLog( msg );
  +	loghelper.log(msg);
       }
   
       private final void logInt(String msg) {
  -	doLog( "CM: " + msg );
  +	loghelper.log(msg);
       }
   
       public final void doLog(String msg) {
  -	doLog( msg, null);
  +	loghelper.log(msg);
       }
       
       public final void doLog(String msg, Throwable t) {
  -	if (firstLog == true) {
  -	    cmLog = Logger.getLogger("tc_log");
  -	    if( cmLog!= null ) {
  -		cmLog.setCustomOutput("true");
  -		cmLog.setVerbosityLevel(Logger.INFORMATION);
  -	    }
  -	    firstLog = false;
  -	}
  +	loghelper.log(msg, t);
  +    }
   
  -	if (cmLog != null) {
  -	    cmLog.log(msg + "\n", t, Logger.INFORMATION);
  -	    // XXX \n should be added to logger, portable
  -	} else {
  -	    System.out.println(msg);
  -	    if( t!=null ) 
  -		t.printStackTrace( System.out );
  -	}
  +    public final void doLog(String msg, Throwable t, int level) {
  +	loghelper.log(msg, t, level);
       }
   
       // -------------------- Accounting --------------------
  
  
  

Mime
View raw message