Skip to main content

Scribe log writer and logging handler.

Project description

Build Status Code Climate Coverage Status License Downloads

Scribe logger

This package contains a low level interface for writing to Scribe, as well as a higher level log handler which plays nicely with Python’s logging facilities.

Supports Python 2.7

Installation

pip install scribe-logger

Testing locally

git clone https://github.com/adilansari/python-scribe-logger.git
cd python-scribe-logger
pip install -U -r requirements.txt
python runtests.py

Logger usage

from scribe_logger.logger import ScribeLogHandler
import logging

my_logger = logging.getLogger('MyLogger')
my_logger.setLevel(logging.DEBUG)

scribe = ScribeLogHandler('localhost', 1464, category='test_category')
scribe.setLevel(logging.DEBUG)
my_logger.addHandler(scribe)

my_logger.info('This is a test message')

Logger raises exceptions

Writer usage

from scribe_logger.writer import ScribeWriter

writer = ScribeWriter('localhost', 1464, 'test_category')
try:
    writer.write('test_message_1')
    writer.write(['test_message_1', 'test_message_2', 'test_message_3'])
except ScribeLoggerError:
    raise

Use silent=True To suppress exceptions:

writer = ScribeWriter('localhost', 1464, 'test_category', silent=True)
writer.write('test_message_1')
writer.write(['test_message_1', 'test_message_2', 'test_message_3'])

Contributors

@adilansari @mwhooker @lenn0x

Project details


Download files

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

Source Distribution

scribe_logger-1.2.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file scribe_logger-1.2.tar.gz.

File metadata

File hashes

Hashes for scribe_logger-1.2.tar.gz
Algorithm Hash digest
SHA256 63359b11404599e0ac0297a18441c9b82d96c07400669437e8541324b40e7c30
MD5 b85c707e90a98e3cc933dab10ff44d28
BLAKE2b-256 5ef1fed65337cb9127ae67a26f991d1dc3f49781e283f0bcbac5df73eab8a6c1

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