Go to the latest version of this document.
search in docstrings

Search bar offers the following options:

- Term presence. The below example searches for documents that must contain “foo”, might contain “bar” and must not contain “baz”: `+foo bar -baz`
- Wildcards. The below example searches for documents with words beginning with “foo”: `foo*`
- Search in specific fields. The following search matches all objects in "twisted.mail" that matches “search”: `+qname:twisted.mail.* +search`

  Possible fields: 'name', 'qname' (fully qualified name), 'docstring', and 'kind'. Last two fields are only applicable if "search in docstrings" is enabled.

- Fuzzy matches. The following search matches all documents that have a word within 1 edit distance of “foo”: `foo~1`

Results provided by Lunr.js

# ``twisted`.`logger`.`STDLibLogObserver``

class documentation

`class STDLibLogObserver: (source)`

Implements interfaces: `twisted.logger.ILogObserver`

View In Hierarchy

Log observer that writes to the python standard library's `logging` module.

Note
Warning: specific logging configurations (example: network) can lead to this observer blocking. Nothing is done here to prevent that, so be sure to not to configure the standard library logging module to block when used in conjunction with this module: code within Twisted, such as twisted.web, assumes that logging does not block.

Method | `__call__` | Format an event and bridge it to Python logging.
Method | `__init__` | No summary
Class Variable | `defaultStackDepth` | This is the default number of frames that it takes to get from `STDLibLogObserver` through the logging module, plus one; in other words, the number of frames if you were to call a `STDLibLogObserver` directly...
Instance Variable | `logger` | Undocumented
Instance Variable | `stackDepth` | Undocumented
Method | `_findCaller` | Based on the stack depth passed to this `STDLibLogObserver`, identify the calling function.

def __call__(self, event): (source)
from `twisted.logger.ILogObserver`

Format an event and bridge it to Python logging.

Parameters
event:`LogEvent` | Undocumented

def __init__(self, name='twisted', stackDepth=defaultStackDepth): (source)

Parameters
name:`str` | logger identifier.
stackDepth:`int` | The depth of the stack to investigate for caller metadata.

defaultStackDepth: `int` = (source)

This is the default number of frames that it takes to get from `STDLibLogObserver` through the logging module, plus one; in other words, the number of frames if you were to call a `STDLibLogObserver` directly. This is useful to use as an offset for the `stackDepth` parameter to `__init__`, to add frames for other publishers.

logger = (source)

Undocumented

stackDepth = (source)

Undocumented

def _findCaller(self, stackInfo=False, stackLevel=1): (source)

Based on the stack depth passed to this `STDLibLogObserver`, identify the calling function.

Parameters
stackInfo:`bool` | Whether or not to construct stack information. (Currently ignored.)
stackLevel:`int` | The number of stack frames to skip when determining the caller (currently ignored; use stackDepth on the instance).
Returns
`Tuple[str, int, str, None]` | Depending on Python version, either a 3-tuple of (filename, lineno, name) or a 4-tuple of that plus stack information.