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
Parameter Default Description
stderr
bool
True

Log to stderr when there is no active app.

stdout
bool
False

Log to stdout when there is not active app.

emit method

def emit(self, record):

Invoked by logging.