logmuse
Logging setup
What it is and what it does
Logmuse is a small utility that bridges argparse and Python's standard logging module, letting you add three standard CLI options (`--verbosity`, `--silent`, `--logdev`) to your command-line tool in one line. Instead of writing your own logging setup code, you call `add_logging_options()` to inject these arguments into your parser, then `logger_via_cli()` to configure the root logger based on what the user passed. All loggers in your package and its dependencies automatically respect these settings.
The package is designed for CLI tools that want familiar logging controls without boilerplate. It works with standard Python logging, so imported packages don't need logmuse at all—they just use `logging.getLogger(__name__)` and inherit the configuration from your CLI entry point. The main gotcha is to avoid calling `init_logger()` at import time, which would break library usage by replacing handlers before the root logger can be configured.
Use it for:
- Add standard logging controls to a CLI tool without writing custom argparse setup or logging configuration code.
- Let users control verbosity levels (1–5 mapping to CRITICAL through DEBUG) and developer mode from the command line.
- Silence all logging output with `--silent` for scripting or batch workflows.
- Enable detailed developer logging with timestamps and line numbers via `--logdev` for debugging.
- Configure logging in an interactive Python session with `init_logger()` for quick testing.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Adds standard CLI logging options (`--verbosity`, `--silent`, `--logdev`) to argparse-based command-line tools, with a simple interface to configure Python's standard logging from command-line arguments.
Yes. Logmuse is a lightweight, actively maintained utility with no dependencies, permissive licensing, and a clear single purpose: reducing boilerplate for CLI logging. Install it if you're building a command-line tool with argparse and want standard logging options without writing setup code. Skip it only if you prefer to manage logging configuration yourself or don't need CLI-driven verbosity control.
Install
logmuse on PyPI
pip
pip install logmuseuv
uv add logmusepoetry
poetry add logmuseInstalling logmuse
Before you install
Low friction: pure Python wheel with no runtime dependencies. Active maintenance—released 7 days ago with commits through 2026-08-07. Supports Python 3.10 through 3.14.
License in practice
BSD-2-Clause (permissive): you can use, modify, and distribute logmuse freely in commercial and open-source projects with minimal restrictions.
Quickstart
pip install logmuse
import argparse
import logmuse
parser = argparse.ArgumentParser()
parser = logmuse.add_logging_options(parser)
args = parser.parse_args()
logger = logmuse.logger_via_cli(args)
logger.info("Hello, world!")
Verify before relying
- Whether logmuse's root logger configuration works correctly when the package is imported as a library by other code
- Performance impact of logmuse's handler setup on applications with many loggers
Package facts
| License | BSD-2-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 7 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 122,441/month — #11,950 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: logmuse-0.3.1-py3-none-any.whl
Keywords: logger, logging, logs, workflow
Tags
More Bio-Informatics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
biopythonBiopython provides Python tools for…
unclear · top 5,000 on PyPI
firecrawl-pyClient library for the Firecrawl API that…
permissive · top 5,000 on PyPI
intervaltreeA self-balancing interval tree data structure…
permissive · top 5,000 on PyPI
albumentationsAlbumentations applies image transformations to…
permissive · top 5,000 on PyPI
PubChemPyPubChemPy is a Python wrapper around the…
permissive · top 5,000 on PyPI
jaraco.loggingAdds command-line argument parsing for Python…
permissive · top 15,000 on PyPI
TwiggyTwiggy is a structured logging library that…
permissive · top 15,000 on PyPI
logistrologistro wraps Python's standard logging module…
permissive · top 5,000 on PyPI
vmoduleAdds glog-style verbose logging levels to…
permissive · top 15,000 on PyPI
verboselogsAdds four custom logging levels (NOTICE, SPAM,…
permissive · top 15,000 on PyPI
glogA simplified Google-style logging wrapper that…
permissive · top 15,000 on PyPI
logging-treeVisualizes the hierarchy of loggers, handlers,…
permissive · top 15,000 on PyPI
tiered-debugA Python logging helper that enables multiple…
permissive · top 15,000 on PyPI
snakemake-interface-logger-pluginsProvides a stable interface specification for…
unclear · top 15,000 on PyPI
codemagic-cli-toolsProvides command-line and Python API tools for…
copyleft · top 5,000 on PyPI