https://issues.apache.org/jira/browse/WICKET-1946

Patch is attached - just needs to be reviewed / applied.

Thanks!

-- 
Jeremy Thomerson
http://www.wickettraining.com


On Thu, Nov 20, 2008 at 9:24 AM, Johan Compagner <[EMAIL PROTECTED]>wrote:

> Please make a case then i will do this when i am home (and dont forget it)
>
> On 11/20/08, Jeremy Thomerson <[EMAIL PROTECTED]> wrote:
> > Could we please make the method above protected (rather than private).
>  This
> > makes it very simple to do something like this:
> >
> >     @Override
> >     protected IRequestLogger newRequestLogger() {
> >         return new RequestLogger() {
> >             @Override
> >             protected void log(RequestData rd, SessionData sd) {
> >                 // do my custom logging HERE
> >             }
> >         };
> >     }
> >
> > ALSO - it would be real nice if at the same time you extract that
> creation
> > of the AppendingStringBuffer to a method, so that the log method now
> looks
> > like:
> >
> > protected void log(RequestData rd, SessionData sd)
> > {
> >     if (log.isInfoEnabled())
> >     {
> >         log.info(createStringBuffer(rd, sd, true);
> >     }
> > }
> > protected final void createStringBuffer(RequestData rd, SessionData sd,
> > boolean includeRuntimeInfo)
> > {
> >     ... all of the stuff that was taken out of log that creates the ASB
> >     if (includeRuntimeInfo)
> >     {
> >         Runtime runtime = Runtime.getRuntime();
> >         long max = runtime.maxMemory() / 1000000;
> >         long total = runtime.totalMemory() / 1000000;
> >         long used = total - runtime.freeMemory() / 1000000;
> >         asb.append(",maxmem=");
> >         asb.append(max);
> >         asb.append("M,total=");
> >         asb.append(total);
> >         asb.append("M,used=");
> >         asb.append(used);
> >         asb.append("M");
> >     }
> >     return asb;
> > }
> >
> > --
> > Jeremy Thomerson
> > http://www.wickettraining.com
> >
>

Reply via email to