Verbose Logging Levels

1.7 · active · verified Sun Apr 12

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.

Warnings

Install

Imports

Quickstart

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.')

view raw JSON →