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.

Files for zc.loggermonitor, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size zc.loggermonitor-0.1.tar.gz (2.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page