A small cli tool to silence process logs and get them back on demand.
Project description
sualw
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
def8924f8e46aba9bfb7b84d85838c5d62e0178ddd023172eefa1c17d4089e5c
|
|
| MD5 |
bc9184186d8ccbe7e37c817c458d3264
|
|
| BLAKE2b-256 |
d13fb92a2513f62ff1023006dac7ed96780b25b059fe0de00f29f86f1c77387c
|
Provenance
The following attestation bundles were made for sualw-0.1.0.tar.gz:
Publisher:
publish.yml on EmmanuelNiyonshuti/sualw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sualw-0.1.0.tar.gz -
Subject digest:
def8924f8e46aba9bfb7b84d85838c5d62e0178ddd023172eefa1c17d4089e5c - Sigstore transparency entry: 1238718595
- Sigstore integration time:
-
Permalink:
EmmanuelNiyonshuti/sualw@820f82c06d858f9c25dc3c5c3d0e21c1cceaa873 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/EmmanuelNiyonshuti
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@820f82c06d858f9c25dc3c5c3d0e21c1cceaa873 -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e29f650d38dab4d9622e97c3fffbf12272557a476ccc59361be3e941fa26c30b
|
|
| MD5 |
5e165adc307f6e92790fc26fb0c1b93c
|
|
| BLAKE2b-256 |
afb0724169b2a8abf6099e491fd8540622cdcd8d92e1e146b3750814eff0b403
|
Provenance
The following attestation bundles were made for sualw-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on EmmanuelNiyonshuti/sualw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sualw-0.1.0-py3-none-any.whl -
Subject digest:
e29f650d38dab4d9622e97c3fffbf12272557a476ccc59361be3e941fa26c30b - Sigstore transparency entry: 1238718601
- Sigstore integration time:
-
Permalink:
EmmanuelNiyonshuti/sualw@820f82c06d858f9c25dc3c5c3d0e21c1cceaa873 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/EmmanuelNiyonshuti
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@820f82c06d858f9c25dc3c5c3d0e21c1cceaa873 -
Trigger Event:
push
-
Statement type: