Registry / observability / verboselogs

verboselogs

JSON →
library1.7pypypi✓ verified 23d ago

The `verboselogs` package extends Python's standard `logging` module by introducing additional log levels: NOTICE, SPAM, SUCCESS, and VERBOSE. These levels are strategically positioned within the existing hierarchy (e.g., NOTICE between WARNING and INFO, VERBOSE between INFO and DEBUG) to provide more granular control over log output. Version 1.7 is currently active, and its release cadence has been stable, with the last update in 2017.

pip install verboselogs
INSTALL
IMPORT
SIG · VERBOSELOGS
V
verboselogs
observabilitypythonv1.7
Install
1.5s avg
Import
18ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.7 · 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.018s · 17.8MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.5s · import 0.018s · 18MB
16MB installed
● package 16MB
Code
Verified usage

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

VerboseLogger
from verboselogs import VerboseLogger
NOTICE
import verboselogs; verboselogs.NOTICE
SPAM
import verboselogs; verboselogs.SPAM
SUCCESS
import verboselogs; verboselogs.SUCCESS
VERBOSE
import verboselogs; verboselogs.VERBOSE

Initialize a VerboseLogger, add a stream handler, and set the logging level to VERBOSE to see messages from VERBOSE and higher levels, including custom levels like SPAM, NOTICE, and SUCCESS. The example demonstrates logging at various levels.

import logging import verboselogs logger = verboselogs.VerboseLogger('my-app') logger.addHandler(logging.StreamHandler()) logger.setLevel(verboselogs.VERBOSE) logger.spam('This is a SPAM message.') logger.verbose('This is a VERBOSE message, providing detailed info.') logger.debug('This is a standard DEBUG message.') logger.info('This is a standard INFO message.') logger.notice('This is a NOTICE message, between INFO and WARNING.') logger.success('This is a SUCCESS message, confirming an operation.') logger.warning('This is a standard WARNING message.')
Debug
Known issues
gotchaMixing standard `logging.getLogger()` with `verboselogs.VerboseLogger()` for the same logger name can lead to unexpected behavior if not handled carefully. Always ensure you consistently use `VerboseLogger` for loggers where custom levels are expected, or explicitly call `verboselogs.install()` to patch the root logger.
fix
Use `logger = verboselogs.VerboseLogger('my_logger_name')` for all instances where custom levels are required, or call `verboselogs.install()` early in your application to make `logging.getLogger()` return a `VerboseLogger` instance.
affects: All
gotchaWhen integrating with other logging configuration methods (e.g., `logging.basicConfig` or file-based configurations), ensure that the log level of handlers and formatters is set appropriately to allow the new, lower `SPAM` and `VERBOSE` levels to pass through. Default configurations often filter out anything below `INFO` or `WARNING`.
fix
Explicitly set `setLevel()` on your handlers and the logger itself to `verboselogs.SPAM`, `verboselogs.VERBOSE`, or `logging.DEBUG` to ensure all desired messages are processed. For example, `handler.setLevel(verboselogs.SPAM)`.
affects: All
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'verboselogs'
The 'verboselogs' package has not been installed in the Python environment where the code is being run.
fix
pip install verboselogs
AttributeError: 'Logger' object has no attribute 'notice'
The standard 'logging.Logger' class has not been patched or replaced by 'verboselogs' to include the new log methods like 'notice'.
fix
import verboselogs
verboselogs.install()
AttributeError: module 'logging' has no attribute 'NOTICE'
The new log level constants (e.g., NOTICE, SPAM, SUCCESS, VERBOSE) defined by 'verboselogs' are not available under the standard 'logging' module until 'verboselogs' has patched it.
fix
import verboselogs
verboselogs.install()
Upgrade
Version history
1.7latest on PyPI · released Aug 7, 2017
Audit
Dependencies

No dependency data recorded yet.

Agent activity
32 hits · last 30 days
node
28
OpenAI (training)
1
Resources
verboselogs — pip install verboselogs · libregistry