Send an event to a Changelog server.
To install ccp, simply:
$ pip install ccp
- INFO
- NOTIFICATION
- WARNING
- ERROR
- CRITICAL
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 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.