Metadata-Version: 2.4
Name: textual_logging
Version: 0.3.0
Summary: A logging widget for Textual applications to display Python logging records
Project-URL: Homepage, https://github.com/gzzi/textual_logging
Project-URL: Repository, https://github.com/gzzi/textual_logging
Author-email: Guillaume Galeazzi <guillaume.galeazzi@gmail.com>
License: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
Classifier: Operating System :: Microsoft :: Windows :: Windows 11
Classifier: Operating System :: OS Independent
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Python: >=3.7
Requires-Dist: rich
Requires-Dist: textual
Provides-Extra: dev
Requires-Dist: mypy; extra == 'dev'
Requires-Dist: pre-commit; extra == 'dev'
Requires-Dist: ruff; extra == 'dev'
Description-Content-Type: text/markdown

# Textual widget to display python logging log entry

The goal of `textual_logging.Logging` widget is to display log from python logging library inside a textual application.
The records are saved in order to change format later and to speedup display.

The logger can be specified when instanciating the widget. By default the root logger is used.
This allow to have multiple widget on the same application showing different logger.

The logger can use any formatter.
The logger must have a `textual_logging.LoggingHandler` handler.

## Install

The packet is on pypi. To install it use `pip install textual_logging`.

## Example

The file [runner.py](./src/textual_logging/runner.py) contain a example application `textual_logging.TextualLogger` that use the widget.
It also conain a function `textual_logging.run` that can be used directly with a `Callable`.

The file [demo.py](./src/textual_logging/demo.py) show a basic usage.

## Demo

Run:

```bash
python3 -m textual_logging
```

it will log 10'000 messages in each severity.
You can press `t` to show/hide log record time.
You can press `l` to show/hide log record level.
You can press `m` to show/hide log record message.
You can press `c` to clear the logs.
You can press `s` to change severity.
To exit, press `Ctrl + q`.
