Skip to main content

Simplified event and data formatting and logging.

Project description

Documentation Latest Version Wheel Available Python versions MIT License

Simplified event and data formatting and logging.

Kaviar aids developers in need of a convenient way to produce structured representation of key-value pairs for logging or representation with a fixed syntax suit suited for later evaluation or just aesthetic reasons.

Example

Logging a certain event:

import logging
from kaviar import EventKvLoggerAdapter

logging.basicConfig(level=logging.DEBUG)
logger = EventKvLoggerAdapter.get_logger(__name__)
logger.info('NEW_CLIENT', client_id=42, peer_name='93.184.216.119')

Separating the event definition from actual logging:

import logging
from functools import partial
from kaviar import EventKvLoggerAdapter

logging.basicConfig(level=logging.DEBUG)
logger = EventKvLoggerAdapter.get_logger(__name__)

log_event = partial(logger.define_logger_func(logging.INFO,
                                              'server peer_name'),
                    'NEW_CLIENT')

log_event('example.org', '93.184.216.164')

Release history Release notifications

This version
History Node

1.0

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
kaviar-1.0-py2.py3-none-any.whl (11.5 kB) Copy SHA256 hash SHA256 Wheel 3.4
kaviar-1.0.zip (22.3 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page