A Logsnag API Wrapper for Rust

Crate API

logsnag is a simple and efficient Rust library for interacting with the Logsnag API. It supports asynchronous requests and allows easy publication of logs and insights.

Features

Getting Started

First, add logsnag to your Cargo.toml:

toml [dependencies] logsnag = "0.2.0" Then, import it in your file(s).

rust use logsnag::Logsnag; use logsnag::models::InsightValue; //Only required for Insights

Usage

Here is a basic example of how to use the Logsnag client:

```rust use logsnag::Logsnag; use logsnag::models::InsightValue;

async fn main() { let client = Logsnag::new("my-api-token", "my-project");

let publish_response = client.publish(
    "channel",
    "event",
    Some("description"),
    Some("icon"),
    Some(true)
).await.expect("Failed to publish log");

let insight_response = client.insight(
    "my-title", 
    "my-event", 
    InsightValue::new("online"), //or InsightValue::new(10) for numbers 
    Some("❤️")
).await.expect("Failed to publish insight");

} ```

See the API Documentation for more details.

Contributing

Please feel free to submit issues, fork the repository and send pull requests!

Any questions, you can find me (rhh4x0r) on the Official Logsnag Discord Server or submit an issue.