mo-logs
More Logs! Structured Logging and Exception Handling
Decision gist · record as of 2026-08-14
Yes, if you are building systems that require structured logging and want exception handling semantics tightly integrated with logging. The low install friction, active maintenance, and zero known vulnerabilities make it safe to adopt. The copyleft license is a minor constraint if you plan to keep the library proprietary, but acceptable for most open-source and internal projects. Not necessary if you are satisfied with standard Python logging or do not need JSON-structured output.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction install with four lightweight runtime dependencies (mo-dots, mo-future, mo-imports, mo-kwargs).
- Active maintenance with recent commits and stable production status.
License · maintenance · safety
MPL 2.0 (copyleft) — Licensed under MPL 2.0 (copyleft). You must disclose source code modifications and can use it in proprietary software, but derivative works of the library itself must remain open-source.
last release 2026-03-02 (165 days) · last repo commit 2026-03-02 · 3 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 117,824 downloads/mo, #12,147 on PyPI
Alternatives
Verify before relying
from mo_logs import logger
logger.info("Hello, {name}!", name="World!")
try:
# code that might fail
except Exception as cause:
logger.error("Failed to process", cause=cause)- Whether the library's automatic context tracking (file, line, method, thread, machine info) has measurable performance impact in high-throughput scenarios.
- How well the JSON serialization handles circular references or non-standard Python objects in logged parameters.
What it is and what it does
mo-logs is a structured logging library that outputs all logs as JSON and tightly integrates exception handling into the logging flow. Instead of using Python's standard logging module, you import a single logger object and call methods like logger.info() or logger.error() with message templates and named parameters. The library automatically captures calling context (file, line, method, thread, machine details) without requiring you to create logger instances per module.
The key design principle is that exceptions and logging are inseparable: logger.error() raises an exception that can be caught by calling code, and only logs if it propagates uncaught. You chain exceptions using a cause parameter rather than raise-from syntax, and can test whether a specific exception message template exists anywhere in the causal chain using the in operator. All parameters are kept separate from the template string to preserve structure for downstream log analysis tools.
Use it for
- Build microservices or distributed systems where structured JSON logs feed into centralized log aggregation and analysis tools.
- Debug complex call chains by attaching extra properties to all subsequent log messages, including those from spawned threads.
- Replace standard Python logging in existing codebases by changing import statements without rewriting exception handling logic.
- Log parametric data safely without risk of accidentally including sensitive local variables (the library discourages locals() usage).
- Identify root causes in exception chains without creating custom exception classes—exceptions are identified by their message templates.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you are building systems that require structured logging and want exception handling semantics tightly integrated with logging.
The low install friction, active maintenance, and zero known vulnerabilities make it safe to adopt. The copyleft license is a minor constraint if you plan to keep the library proprietary, but acceptable for most open-source and internal projects. Not necessary if you are satisfied with standard Python logging or do not need JSON-structured output.
Install
mo-logs on PyPI
Before you install
Low friction install with four lightweight runtime dependencies (mo-dots, mo-future, mo-imports, mo-kwargs). Active maintenance with recent commits and stable production status.
License in practice
Licensed under MPL 2.0 (copyleft). You must disclose source code modifications and can use it in proprietary software, but derivative works of the library itself must remain open-source.
Quickstart
from mo_logs import logger
logger.info("Hello, {name}!", name="World!")
try:
# code that might fail
except Exception as cause:
logger.error("Failed to process", cause=cause)
Verify before relying
- Whether the library's automatic context tracking (file, line, method, thread, machine info) has measurable performance impact in high-throughput scenarios.
- How well the JSON serialization handles circular references or non-standard Python objects in logged parameters.
Package facts
| License | MPL 2.0 copyleft |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 4 packagesmo-dotsmo-futuremo-importsmo-kwargs |
| Maintenance | Actively maintained 165 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 117,824 / month, #12,147 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableLicense :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.15Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules |
Evidence: mo_logs-8.703.26061-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “exception handling logging”
- mo-logsProvides structured JSON logging with integrated exception handling…
- essentialsEssentials provides reusable core classes and utility functions for…
- informInform provides specialized print functions for displaying formatted…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also JSON-log-formatter · lib-log-rich · json-logging · eliot · Twiggy · splunk-hec-handler · django-log-formatter-asim · logstash_formatter · django-structlog · python-json-logger