Skip to main content

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()

Project details


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