Soup.Logger¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The level of logging output |
||
r/w |
The maximum body size to output |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Soup.Logger(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- classmethod new(level, max_body_size)¶
- Parameters:
level (
Soup.LoggerLogLevel
) – the debug levelmax_body_size (
int
) – the maximum body size to output, or -1
- Returns:
a new
Soup.Logger
- Return type:
Creates a new
Soup.Logger
with the given debug level. If level isSoup.LoggerLogLevel.BODY
, max_body_size gives the maximum number of bytes of the body that will be logged. (-1 means “no limit”.)If you need finer control over what message parts are and aren’t logged, use
Soup.Logger.set_request_filter
() andSoup.Logger.set_response_filter
().
- attach(session)¶
- Parameters:
session (
Soup.Session
) – aSoup.Session
Sets self to watch session and print debug information for its messages.
(The session will take a reference on self, which will be removed when you call
Soup.Logger.detach
(), or when the session is destroyed.)Deprecated since version ???: Use
Soup.Session.add_feature
() instead.
- detach(session)¶
- Parameters:
session (
Soup.Session
) – aSoup.Session
Stops self from watching session.
Deprecated since version ???: Use
Soup.Session.remove_feature
() instead.
- set_printer(printer, *printer_data)¶
- Parameters:
printer (
Soup.LoggerPrinter
) – the callback for printing logging outputprinter_data (
object
orNone
) – data to pass to the callback
Sets up an alternate log printing routine, if you don’t want the log to go to
stdout
.
- set_request_filter(request_filter, *filter_data)¶
- Parameters:
request_filter (
Soup.LoggerFilter
) – the callback for request debugging
Sets up a filter to determine the log level for a given request. For each HTTP request self will invoke request_filter to determine how much (if any) of that request to log. (If you do not set a request filter, self will just always log requests at the level passed to
Soup.Logger.new
().)
- set_response_filter(response_filter, *filter_data)¶
- Parameters:
response_filter (
Soup.LoggerFilter
) – the callback for response debugging
Sets up a filter to determine the log level for a given response. For each HTTP response self will invoke response_filter to determine how much (if any) of that response to log. (If you do not set a response filter, self will just always log responses at the level passed to
Soup.Logger.new
().)
Property Details¶
- Soup.Logger.props.level¶
- Name:
level
- Type:
- Default Value:
- Flags:
The level of logging output
New in version 2.56.
- Soup.Logger.props.max_body_size¶
-
If
Soup.Logger
:level
isSoup.LoggerLogLevel.BODY
, this gives the maximum number of bytes of the body that will be logged. (-1 means “no limit”.)New in version 2.56.