
Enhances project management by sending notifications and tracking events, user properties, and insights through an intuitive client interface for efficient monitoring and analysis.
build.gradle.kts file:repositories {
mavenCentral()
}
dependencies {
implementation("io.github.vinceglb:logsnag-kotlin:1.1.1")
}Create an instance of LogSnag client:
val logSnag = LogSnag(
token = "your-token",
project = "your-project",
)Send a track event to LogSnag:
logSnag.track(
channel = "waitlist",
event = "User Joined",
description = "A user joined the waitlist",
icon = "π",
userId = "user_123",
tags = mapOf("source" to "google"),
notify = true,
)Identify a user and set their properties:
logSnag.identify(
userId = "user_123",
properties = mapOf(
"name" to "John Doe",
"email" to "john@doe.com",
"plan" to "premium",
),
)Send a insight track to LogSnag:
logSnag.insightTrack(
title = "User Count",
value = "100",
icon = "π¨",
)Increment an insight track to LogSnag:
logSnag.insightIncrement(
title = "User Count",
value = 1,
icon = "π¨",
)To be able to work on the project locally, you need to update the local.properties file with your LogSnag token and project ID:
LOGSNAG_TOKEN=your-token
LOGSNAG_PROJECT=your-projectbuild.gradle.kts file:repositories {
mavenCentral()
}
dependencies {
implementation("io.github.vinceglb:logsnag-kotlin:1.1.1")
}Create an instance of LogSnag client:
val logSnag = LogSnag(
token = "your-token",
project = "your-project",
)Send a track event to LogSnag:
logSnag.track(
channel = "waitlist",
event = "User Joined",
description = "A user joined the waitlist",
icon = "π",
userId = "user_123",
tags = mapOf("source" to "google"),
notify = true,
)Identify a user and set their properties:
logSnag.identify(
userId = "user_123",
properties = mapOf(
"name" to "John Doe",
"email" to "john@doe.com",
"plan" to "premium",
),
)Send a insight track to LogSnag:
logSnag.insightTrack(
title = "User Count",
value = "100",
icon = "π¨",
)Increment an insight track to LogSnag:
logSnag.insightIncrement(
title = "User Count",
value = 1,
icon = "π¨",
)To be able to work on the project locally, you need to update the local.properties file with your LogSnag token and project ID:
LOGSNAG_TOKEN=your-token
LOGSNAG_PROJECT=your-project