Skip to main content

UNKNOWN

Project description

The zc.loggermonitor package provides a zc.monitor plugin for getting and setting logger levels.

>>> import sys, zc.loggermonitor

It is an error to call the monitor without user arguments.

>>> zc.loggermonitor.level(sys.stdout)
Traceback (most recent call last):
...
TypeError: level() takes at least 2 arguments (1 given)

If you pass it a logger name, it returns the current effective level:

>>> zc.loggermonitor.level(sys.stdout, '.')
NOTSET
>>> zc.loggermonitor.level(sys.stdout, 'mylogger')
NOTSET

If you pass a level it sets the level:

>>> zc.loggermonitor.level(sys.stdout, '.', 'INFO')
>>> zc.loggermonitor.level(sys.stdout, '.')
INFO
>>> zc.loggermonitor.level(sys.stdout, 'mylogger')
INFO

You can also pass a numeric value:

>>> zc.loggermonitor.level(sys.stdout, 'mylogger', '5')
>>> zc.loggermonitor.level(sys.stdout, '.')
INFO
>>> zc.loggermonitor.level(sys.stdout, 'mylogger')
Level 5
>>> zc.loggermonitor.level(sys.stdout, 'mylogger', '10')
>>> zc.loggermonitor.level(sys.stdout, '.')
INFO
>>> zc.loggermonitor.level(sys.stdout, 'mylogger')
DEBUG
>>> zc.loggermonitor.level(sys.stdout, 'mylogger', 'NOTSET')
>>> zc.loggermonitor.level(sys.stdout, '.')
INFO
>>> zc.loggermonitor.level(sys.stdout, 'mylogger')
INFO
>>> zc.loggermonitor.level(sys.stdout, '.', 'NOTSET')
>>> zc.loggermonitor.level(sys.stdout, '.')
NOTSET
>>> zc.loggermonitor.level(sys.stdout, 'mylogger')
NOTSET

Download

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zc.loggermonitor-0.1.tar.gz (2.8 kB view details)

Uploaded Source

File details

Details for the file zc.loggermonitor-0.1.tar.gz.

File metadata

File hashes

Hashes for zc.loggermonitor-0.1.tar.gz
Algorithm Hash digest
SHA256 9d0e47150c8674733267c647df837838c19a6d8b32534f4f4b43ff3a80dca176
MD5 906c3f2b8a841453a2832e87dbc534c3
BLAKE2b-256 5b2d3963a7c95b2088ef60da6433c07809b73eb83d54a35eaa2af222d3f8edc5

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page