Registry / observability / mo-logs

mo-logs

JSON →
library8.703.26061pypypi✓ verified 85d ago

Structured logging and exception handling library for Python, part of the mo-* family. Current version 8.703.26061. Provides structured logging with sensible defaults and a simple API. Release cadence is frequent and automated.

pip install mo-logs
INSTALL
IMPORT
SIG · MO-LOGS
M
mo-logs
observabilitypythonv8.703.26061
Install
1.8s avg
Import
133ms
Disk
17MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v8.703.26061 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.136s · 18.5MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.8s · import 0.130s · 19MB
17MB installed
● package 17MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Log
from mo_logs import Log
setup_logging
from mo_logs import setup_logging
Except
from mo_logs import Except

Basic setup and usage of mo-logs for structured logging.

from mo_logs import Log, setup_logging from mo_logs import constants # Setup logging (call once at startup) setup_logging() # Basic logging Log.note("This is a log message") Log.note("Message with {field}", field="value") # Warning Log.warning("This is a warning") # Error handling from mo_logs import Except try: raise ValueError("something went wrong") except ValueError as e: error = Except.wrap(e) Log.error("An error occurred: {error}", error=error) # Set constants (like DEBUG flag) constants.set({"DEBUG": True})
Debug
Known issues
breakingImport path changed: from `mo_logs` not `mo-logs`. Python package uses underscores, not hyphens.
fix
Use `from mo_logs import Log` instead of `from mo-logs import Log`.
affects: all
gotchaCall `setup_logging()` before any logging to ensure configuration is applied. If omitted, logging defaults may not be set.
fix
Always call `setup_logging()` at application startup.
affects: all
gotchaDo not use `import mo-logs` directly; the package is not designed to be imported as a module. Always import specific symbols like `Log`.
fix
Use `from mo_logs import Log`.
affects: all
deprecatedThe `start` function in `mo_logs` is deprecated. Use `setup_logging()` instead.
fix
Replace `from mo_logs import start; start()` with `from mo_logs import setup_logging; setup_logging()`.
affects: >=5.0
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'mo-logs'
Trying to import with hyphen instead of underscore.
fix
Use `from mo_logs import Log` (with underscore).
AttributeError: module 'mo_logs' has no attribute 'Log'
Using `import mo_logs` then `mo_logs.Log` but the package may have changed export patterns.
fix
Use `from mo_logs import Log`.
Upgrade
Version history
8.703.26061latest on PyPI · released Mar 2, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
2
Resources
mo-logs — pip install mo-logs · libregistry