Skip to content

LogSnag/logsnag.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LogSnag

LogSnag

Get notifications and track your project events.

Discord Documentation

Installation

pip3 install logsnag

Usage

Import Library

from logsnag import LogSnag

Initialize Client

logsnag = LogSnag(token='7f568d735724351757637b1dbf108e5', project="my-saas")

Publish Event

logsnag.track(
    channel="waitlist",
    event="User Joined",
    user_id="user_123",
    description="Email: [email protected]",
    icon="🎉",
    tags={
      "source": "google",
    },
    notify=True
)

User Properties

logsnag.identify(
    user_id="user_123",
    properties={
        "name": "John Doe",
        "email": "[email protected]",
        "plan": "free",
    }
)

Group Properties

logsnag.group(
    user_id="user_123",
    group_id="group_123",
    properties={
        "name": "ACME Inc.",
        "plan": "enterprise",
        "fund": "Series A",
    }
)

Publish Insight

logsnag.insight.track(
    title='User Count',
    value=100,
    icon='👨',
)

Increment Insight

logsnag.insight.increment(
    title='User Count',
    value=1,
    icon='👨',
)