skillfed

logmuse

Logging setup

logmuse v0.3.1 122.4K downloads/30d#11,950 on PyPI3
Permissive license BSD-2-Clause Active released

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 logmuse

uv

uv add logmuse

poetry

poetry add logmuse

Installing 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

Development Status :: 4 - BetaLicense :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Scientific/Engineering :: Bio-Informatics

Tags

cli logging optionsargparse logging integrationcommand line verbosity controlpython cli logger setuplogging from command line arguments
cli-loggingargparse

More Bio-Informatics packages