Skip to content

woohgit/changelog-client-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CCP: Changelog Client Python

Send an event to a Changelog server.

Installation

To install ccp, simply:

$ pip install ccp

Supported severities

  1. INFO
  2. NOTIFICATION
  3. WARNING
  4. ERROR
  5. CRITICAL

Example

It is pretty easy to use:

from ccp.client import Client

client = Client("localhost", 80)
client.send("This is a simple message", "INFO", "category")

You can pass a dict to specify additional HTTP headers, for example to do authentication:

client.send("Message", "INFO", "category", {"Authorization": "Basic base64encoded"})

You can pass a dict to specify additional database fields:

client.send("Message", "INFO", "category", {"Authorization": "Basic base64encoded"}, extra_fields={"field_1": "value1", "field_2": "value2"})

Logging

Logging happens into the logger called changelog_client by default. You can override it by setting the logger property of a client instance to a Logger object.