1 16 package com.google.gwt.dev.util.log; 17 18 import javax.servlet.ServletContext ; 19 20 23 public class ServletContextTreeLogger extends AbstractTreeLogger { 24 25 private final ServletContext ctx; 26 27 public ServletContextTreeLogger(ServletContext ctx) { 28 this.ctx = ctx; 29 } 30 31 protected AbstractTreeLogger doBranch() { 32 return new ServletContextTreeLogger(ctx); 33 } 34 35 protected void doCommitBranch(AbstractTreeLogger childBeingCommitted, 36 Type type, String msg, Throwable caught) { 37 doLog(childBeingCommitted.getBranchedIndex(), type, msg, caught); 38 } 39 40 protected void doLog(int indexOfLogEntryWithinParentLogger, Type type, 41 String msg, Throwable caught) { 42 if (caught != null) { 43 ctx.log(msg, caught); 44 } else { 45 ctx.log(msg); 46 } 47 } 48 } 49 | Popular Tags |