Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Logs print logs in JSON format.

Project Description

Logs provides a class to save logs in json format. Typical usage often looks like this:

#!/usr/bin/env python

from logs import Logs
import sys

logTypes = [ 'application', 'business', 'debug' ]
logs = Logs('ApplicationName', logTypes)

# Choosing log file name.
logs.setLogType('debug')
# Choosing log message Type
logs.setMessageType('info')
# Choosing log code id
logs.setMessageCodeId('0001')
# Setting message to print
logs.setMessageText('Initiating application [%d]' % sys.argv[0])
# Saving Logs
logs.saveLog()

# Setting new message to print
logs.setMessageText('Second message')
logs.saveLog()
Release History

Release History

This version
History Node

0.1.0

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting