Skip to main content

A small cli tool to silence process logs and get them back on demand.

Project description

sualw

Tests codecov PyPI Python t

A small CLI tool that silences a process, gives you back your terminal, and lets you view the logs later on demand.

Installation:

If you are interested, since it hasn’t been published on PyPI yet, you can install it like this:

pip install git+https://github.com/EmmanuelNiyonshuti/sualw.git

Try it out:

$ sualw uvicorn main:app --reload

Ok.  uvicorn is running quietly  (pid 11292)
   log     ->  /home/emmanuel/.sualw/logs/uvicorn.log
   watch   ->  sualw toggle uvicorn
   stop    ->  sualw stop uvicorn
$ 

List all running processes with:

$ sualw list

 NAME      PID     STATUS    UPTIME   COMMAND                                      
───────────────────────────────────────────────────────────────────────────────────
 uvicorn   11292   running   -7035s   /home/emmanuel/works/sualw/.venv/bin/uvicorn 
                                      main:app --reload
$

Get back the logs with:

$ sualw toggle uvicorn

⟳  uvicorn  (live) - Ctrl+C to detach

WARNING:  StatReload detected changes in 'main.py'. Reloading...
INFO:     Shutting down
INFO:     Waiting for application shutdown.
INFO:     Application shutdown complete.
INFO:     Finished server process [11296]
INFO:     Started server process [12417]
INFO:     Waiting for application startup.
INFO:     Application startup complete.

stop the process with:

$ sualw stop uvicorn

✓  uvicorn received SIGTERM.

It was built out of my need to suppress webserver logs during development and get them back when I need them.There are other tools that can do similar things, but they felt a bit overkill for my simple use case, or maybe I just didn’t explore them well enough.

sualw will save these logs in the home directory under ~/.sualw/logs/{process_name}.log file, keep a json file registry for all processes in ~/.sualw/registry.json.

you can name the process anything you want, it must come before the -- separator right after sualw command, It will not be the name you name your process for example if you run some process that accepts a name and you pass it afterwars sualw myprocess --myprocess_name it will not be named myprocess_name but myprocess.

License

This project is licensed under the terms of the MIT license.

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

sualw-0.1.0.tar.gz (14.5 kB view details)

Uploaded Source

Built Distribution

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

sualw-0.1.0-py3-none-any.whl (17.4 kB view details)

Uploaded Python 3

File details

Details for the file sualw-0.1.0.tar.gz.

File metadata

  • Download URL: sualw-0.1.0.tar.gz
  • Upload date:
  • Size: 14.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sualw-0.1.0.tar.gz
Algorithm Hash digest
SHA256 def8924f8e46aba9bfb7b84d85838c5d62e0178ddd023172eefa1c17d4089e5c
MD5 bc9184186d8ccbe7e37c817c458d3264
BLAKE2b-256 d13fb92a2513f62ff1023006dac7ed96780b25b059fe0de00f29f86f1c77387c

See more details on using hashes here.

Provenance

The following attestation bundles were made for sualw-0.1.0.tar.gz:

Publisher: publish.yml on EmmanuelNiyonshuti/sualw

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file sualw-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: sualw-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for sualw-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e29f650d38dab4d9622e97c3fffbf12272557a476ccc59361be3e941fa26c30b
MD5 5e165adc307f6e92790fc26fb0c1b93c
BLAKE2b-256 afb0724169b2a8abf6099e491fd8540622cdcd8d92e1e146b3750814eff0b403

See more details on using hashes here.

Provenance

The following attestation bundles were made for sualw-0.1.0-py3-none-any.whl:

Publisher: publish.yml on EmmanuelNiyonshuti/sualw

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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