| Class | CallMapping |
Read-only mapping that turns a ()-suffix in key names into an invocation of the key rather than a lookup of the key. |
| Function | formatUnformattableEvent |
Formats an event as text that describes the event generically and a formatting error. |
| Function | formatWithCall |
Format a string like str.format, but: |
| Function | _formatEvent |
Formats an event as a string, using the format in event["log_format"]. |
| Function | _formatSystem |
No summary |
| Function | _formatTraceback |
No summary |
| Parameters | |
event:LogEvent | A logging event. |
error:BaseException | The formatting error. |
| Returns | |
str | A formatted string. |
Format a string like str.format, but:
For example:
>>> formatWithCall("{string}, {function()}.",
... dict(string="just a string",
... function=lambda: "a function"))
'just a string, a function.'
| Parameters | |
formatString:str | A PEP-3101 format string. |
mapping:Mapping[ | A dict-like object to format. |
| Returns | |
str | The string with formatted values interpolated. |
Formats an event as a string, using the format in event["log_format"].
This implementation should never raise an exception; if the formatting cannot be done, the returned string will describe the event generically so that a useful message is emitted regardless.
| Parameters | |
event:LogEvent | A logging event. |
| Returns | |
str | A formatted string. |
| Parameters | |
event:LogEvent | The event containing the system specification. |
| Returns | |
str | A formatted string representing the "log_system" key. |
| Parameters | |
failure:Failure | The failure to retrieve a traceback from. |
| Returns | |
str | The formatted traceback. |