Skip to main content

real time logging via IPython

Project description

ipython-rtlogging

Ipython Real Time Logging

ipython-rtlogging is a tool that relies only on the Python standard library (except for IPython, Rich) and is used to capture and log the output streams of cells in real-time within IPython or IPython Notebook. It provides an optional solution to tackle the problem of losing cell outputs or not being able to monitor the progress of a running code after reconnecting to the Notebook.

https://github.com/wilmerwang/ipython-rtlogging/assets/35020700/be3fa6e5-0d77-415b-a888-a3f70d1a7c12

Dependencies

  • ipython
  • rich

Install

Install the latest release with:

pip install ipython-rtlogging

or download from https://github.com/wilmerwang/ipython-rtlogging and:

cd ipython-rtlogging
python3 setup.py install

Examples

Please cheack this notebook

Usage

Load rt_logging in IPython or IPython Notebook:

In [1]: %load_ext rt_logging

Then can use CLI to monitor the progress of a running code:

# Simaple usage
rt_logging

# OR Just list the running cell
rt_logging -ls

There are some extesion magic method:

In [2]: %%rt_logging?

Docstring:
::

    %rt_logging [--no-stderr] [--no-stdout] [name] [buffering]

run the cell, print and redirect stdout, stderr calls.

positional arguments:
  name         File Name
  buffering    buffering size, 1 to select line buffering. Same as
               open(buffering)

optional arguments:
  --no-stderr  Dont capture stderr.
  --no-stdout  Dont capture stdout.

In [3]: %ls_logging?
Docstring:
::

    %ls_logging [--ll]

list the all logging names

optional arguments:
  --ll  File Name to Load

In [4]: %load_logging?
Docstring:
::

  %load_logging [--name NAME] [--top TOP]

load and print logging data

optional arguments:
  --name NAME  File Names to Load
  --top TOP    top lines to Load

In [5]: %rm_logging?
Docstring:
::

  %rm_logging [--name NAME]

delete logging

optional arguments:
  --name NAME  File Name to Load

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipython-rtlogging-0.2.3.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ipython_rtlogging-0.2.3-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file ipython-rtlogging-0.2.3.tar.gz.

File metadata

  • Download URL: ipython-rtlogging-0.2.3.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.13

File hashes

Hashes for ipython-rtlogging-0.2.3.tar.gz
Algorithm Hash digest
SHA256 32730cc15f9fb654c4e30e69aa42a3ed07d437cd602367950f2a1bdeea7cda27
MD5 8db93f869cefc9ff33941efa2b476058
BLAKE2b-256 a16939ff62de38df4f9e6ee393a34420d7961d8ee4037190907b51b9624d36c1

See more details on using hashes here.

File details

Details for the file ipython_rtlogging-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for ipython_rtlogging-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 1c746bb26801b599d9b409bf8bd5f4bf43568bc293e7e241c1e106321fc537f8
MD5 6e2f87b7e8314d11cae2d23cb4bc5110
BLAKE2b-256 728f1d0ecb2ec2cf1681a3fd435d1c32e16fde4c57ee1ee4acaae4f33c221a2e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page