Install
You install LogLens from its source code with pip, Python's package installer. It takes about a minute and gives you the loglens command.
Good to know
LogLens is not published on the Python Package Index (PyPI) yet, so pip install loglens on its own does not find it. Install from the GitHub repository as shown below. The releases page lists the released versions; the latest is v0.2.0.
What you need
- Linux or macOS
- Python 3.10 or newer. Check with
python3 --version. - Git, to download the source
- A terminal that shows colours (almost every modern terminal does)
LogLens pulls in three libraries during the install: Textual (the terminal interface), watchdog (file change events) and Click (the command line).
Install from source
Download the source and switch to the latest release:
bashgit clone https://github.com/Dhiva-Labs/loglens.git cd loglens git checkout v0.2.0Skip
git checkoutif you want the newest, unreleased code on the main branch.Create a virtual environment, so LogLens and its libraries stay separate from your system's Python:
bashpython3 -m venv .venv source .venv/bin/activateYour prompt now starts with
(.venv). Runsource .venv/bin/activateagain in each new terminal before you use LogLens.Install LogLens:
bashpip install -e .The
-eflag installs it in "editable" mode: theloglenscommand runs the code in this folder, so a latergit pullupdates it.Check that it works:
bashloglens --versionIt prints
loglens, version 0.2.0.
TIP
Keep the cloned folder. It also holds scripts/genlog.py, a small script that writes sample log lines. The beginner guide uses it.
Linux distribution packages
The project has packaging for Fedora, RHEL-family systems, openSUSE and Arch Linux (a noarch .rpm, an Arch package and an AUR build file). These packages are attached only to releases made after v0.2.0, so v0.2.0 itself has none. When a release lists them on its page, install the file with your package manager, for example:
sudo dnf install ./loglens-<version>-1.noarch.rpmOn Arch, use sudo pacman -U ./loglens-<version>-1-any.pkg.tar.zst. For background on installing package files, see Installing apps.
Update or remove
To update, go to the cloned folder, run git pull (or git checkout a newer tag), and run pip install -e . again inside the virtual environment.
To remove LogLens, delete the cloned folder. That also deletes its .venv.