class documentation

class twisted.logger.LoggingFile: (source)

View In Hierarchy

File-like object that turns write() calls into logging events.

Note that because event formats are str, bytes received via write() are converted to str, which is the opposite of what file does.

Property softspace Undocumented
Method softspace.setter Undocumented
Method __init__ No summary
Instance Variable level Undocumented
Instance Variable log Undocumented
Property closed Read-only property. Is the file closed?
Property encoding Read-only property. File encoding.
Property mode Read-only property. File mode.
Property newlines Read-only property. Types of newlines encountered.
Property name The name of this file; a repr-style string giving information about its namespace.
Method close Close this file so it can no longer be written to.
Method flush No-op; this file does not buffer.
Method fileno Returns an invalid file descriptor, since this is not backed by an FD.
Method isatty A LoggingFile is not a TTY.
Method write Log the given message.
Method writelines Log each of the given lines as a separate message.
Instance Variable _softspace Undocumented
Instance Variable _encoding Undocumented
Instance Variable _buffer Undocumented
Instance Variable _closed Undocumented
Method _unsupported Template for unsupported operations.
@deprecatedProperty(Version('Twisted', 21, 2, 0))
softspace = (source)

Undocumented

_softspace = (source)

Undocumented

@softspace.setter
def softspace(self, value): (source)

Undocumented

def __init__(self, logger, level=LogLevel.info, encoding=None): (source)
Parametersloggerthe logger to log through. (type: Logger)
levelthe log level to emit events with. (type: NamedConstant)
encodingThe encoding to expect when receiving bytes via write(). If None, use sys.getdefaultencoding(). (type: Optional[str])
level = (source)

Undocumented

Undocumented

_encoding = (source)

Undocumented

_buffer = (source)

Undocumented

_closed = (source)

Undocumented

(type: bool)
@property
closed = (source)

Read-only property. Is the file closed?

(type: bool)
@property
encoding = (source)

Read-only property. File encoding.

(type: str)
@property
mode = (source)

Read-only property. File mode.

(type: str)
@property
newlines = (source)

Read-only property. Types of newlines encountered.

(type: None)
@property
name = (source)

The name of this file; a repr-style string giving information about its namespace.

(type: str)
def close(self): (source)

Close this file so it can no longer be written to.

def flush(self): (source)

No-op; this file does not buffer.

def fileno(self): (source)

Returns an invalid file descriptor, since this is not backed by an FD.

Returns-1 (type: int)
def isatty(self): (source)

A LoggingFile is not a TTY.

ReturnsFalse (type: bool)
def write(self, message): (source)

Log the given message.

ParametersmessageThe message to write. (type: AnyStr)
def writelines(self, lines): (source)

Log each of the given lines as a separate message.

ParameterslinesData to write. (type: Iterable[AnyStr])
def _unsupported(self, *args): (source)

Template for unsupported operations.

ParametersargsArguments. (type: object)
API Documentation for Twisted, generated by pydoctor 20.12.1 at 2021-02-28 19:53:36.