Google APIs Client Library for C++
|
Base class for scribe to log HTTP message activity. More...
#include "client/transport/http_scribe.h"
Public Member Functions | |
virtual | ~HttpScribe () |
Standard destructor. | |
void | set_max_snippet (int64 n) |
Specifies the max size for captured content snippets. | |
int64 | max_snippet () const |
Returns the max size for captured snippets. | |
virtual void | AboutToSendRequest (const HttpRequest *request)=0 |
Notification that the request is about to be sent to the transport. | |
virtual void | ReceivedResponseForRequest (const HttpRequest *request)=0 |
Notification that a request has received a response. | |
virtual void | RequestFailedWithTransportError (const HttpRequest *request, const util::Status &error)=0 |
Notification that a sent request has encountered a transport error. | |
void | reset_censor (HttpScribeCensor *censor) |
const HttpScribeCensor * | censor () |
virtual void | Checkpoint ()=0 |
Checkpoint the scribe data into the writer if it hasnt been done so already. | |
Protected Member Functions | |
HttpScribe (HttpScribeCensor *censor) | |
Class is abstract so needs to be specialized to construct. |
Base class for scribe to log HTTP message activity.
This is intended for debugging and diagnostics. A transport permits binding a scribe to it to monitor transport activity. This class provides the interface for the interaction between the HTTP requests and scribes.
Scribes should be thread-safe.
virtual ~HttpScribe | ( | ) | [virtual] |
Standard destructor.
HttpScribe | ( | HttpScribeCensor * | censor | ) | [explicit, protected] |
Class is abstract so needs to be specialized to construct.
[in] | censor | Provides policy for censoring data. Ownership is passed. |
virtual void AboutToSendRequest | ( | const HttpRequest * | request | ) | [pure virtual] |
Notification that the request is about to be sent to the transport.
Since the scribe is used in the flow of normal sending activities, it will be the caller's responsibility to reset the requset->body_reader. after invoking this method.
[in] | request | The request being sent. |
Implemented in HttpEntryScribe.
const HttpScribeCensor* censor | ( | ) | [inline] |
virtual void Checkpoint | ( | ) | [pure virtual] |
Checkpoint the scribe data into the writer if it hasnt been done so already.
Implemented in JsonScribe, and HtmlScribe.
int64 max_snippet | ( | ) | const [inline] |
Returns the max size for captured snippets.
virtual void ReceivedResponseForRequest | ( | const HttpRequest * | request | ) | [pure virtual] |
Notification that a request has received a response.
Since the scribe is used in the flow of normal sending activities, it will be the caller's responsibility to reset the request->response->body_reader after invoking this method.
[in] | request | The request holds its response. |
Implemented in HttpEntryScribe.
virtual void RequestFailedWithTransportError | ( | const HttpRequest * | request, |
const util::Status & | error | ||
) | [pure virtual] |
Notification that a sent request has encountered a transport error.
Transport errors are not HTTP errors. This is a timeout or network-level error.
[in] | request | The request that will never receive a response. |
[in] | error | The transport error. |
Implemented in HttpEntryScribe.
void reset_censor | ( | HttpScribeCensor * | censor | ) | [inline] |
void set_max_snippet | ( | int64 | n | ) | [inline] |
Specifies the max size for captured content snippets.
The default is unbounded so the whole message will be kept. If you only need part of the payload then you can use this attribute to restrict the size.
[in] | n | most bytes to capture. |