Skip to content

Logging

A Textual Logging handler.

If there is an active Textual app, then log messages will go via the app (and logged via textual console).

If there is no active app, then log messages will go to stderr or stdout, depending on configuration.

TextualHandler class

def __init__(self, stderr=True, stdout=False):

Bases: Handler

A Logging handler for Textual apps.

Parameters
Name Type Description Default
stderr bool

Log to stderr when there is no active app.

True
stdout bool

Log to stdout when there is not active app.

False

emit method

def emit(self, record):

Invoked by logging.