org.apache.commons.httpclient
Class WireLog

java.lang.Object
  extended by org.apache.commons.httpclient.WireLog

public class WireLog
extends Object

Logs data to the wire LOG.

Since:
2.0beta1
Author:
Oleg Kalnichevski

Field Summary
static int IN_BODY
          selector for logging the response body
static int IN_HEAD
          selector for logging the response header
static int OUT_BODY
          selector for logging the request body
static int OUT_HEAD
          selector for logging the request header
 
Constructor Summary
WireLog(OutputStream log, int what)
          Create a new logger.
 
Method Summary
 WireLogInputStream getInFilter()
          Get the configured response stream wrapper.
 org.apache.commons.httpclient.WireLogOutputStream getOutFilter()
          Get the configured request stream wrapper.
 boolean isEnabled(int what)
          Check, whether the given part should be logged.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OUT_HEAD

public static final int OUT_HEAD
selector for logging the request header

See Also:
Constant Field Values

OUT_BODY

public static final int OUT_BODY
selector for logging the request body

See Also:
Constant Field Values

IN_HEAD

public static final int IN_HEAD
selector for logging the response header

See Also:
Constant Field Values

IN_BODY

public static final int IN_BODY
selector for logging the response body

See Also:
Constant Field Values
Constructor Detail

WireLog

public WireLog(OutputStream log,
               int what)
Create a new logger.

Parameters:
log - where to log stuff
what - what to log. Its a combination (bitmask) of OUT_HEAD, OUT_BODY, IN_HEAD and IN_BODY.
Method Detail

getInFilter

public WireLogInputStream getInFilter()
Get the configured response stream wrapper.

Returns:
null if response logging is disabled, the stream otherwise.

getOutFilter

public org.apache.commons.httpclient.WireLogOutputStream getOutFilter()
Get the configured request stream wrapper.

Returns:
null if response logging is disabled, the stream otherwise.

isEnabled

public boolean isEnabled(int what)
Check, whether the given part should be logged.

Parameters:
what - a combination (bitmask) of OUT_HEAD, OUT_BODY, IN_HEAD and IN_BODY.
Returns:
true if logging is enabled for the given part.


Copyright (c) 1999-2005 - Apache Software Foundation