1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
//! # Exceptionless client for Rust
//!
//! `exceptionless` is an async Rust client for the current Exceptionless MVP slice:
//! error reporting, log events, and feature usage tracking.
//!
//! ## Supported today
//!
//! - Error events with captured stack frames and inner error chaining
//! - Log events with optional source, level, tags, user identity, version, and custom data
//! - Feature usage events with tags, user identity, version, and custom data
//! - Direct async submission to `POST /api/v2/events`
//! - Default hosted collector or a custom self-hosted Exceptionless server
//! - Custom transports through the [`transport::Transport`] trait
//!
//! ## Not yet supported
//!
//! - Automatic queueing, offline storage, or retry workers
//! - Server-side settings/config synchronization
//! - Session tracking
//! - Plugin hooks
//! - Logging facade integrations
//!
//! ## Quick start
//!
//! ```no_run
//! use exceptionless::ExceptionlessClient;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = ExceptionlessClient::with_api_key("YOUR_API_KEY");
//!
//! let result = client
//! .log("worker started")
//! .source("jobs")
//! .level("info")
//! .tag("startup")
//! .send()
//! .await?;
//!
//! if !result.response.is_success() {
//! eprintln!("submission was not accepted: {:?}", result.action);
//! }
//!
//! Ok(())
//! }
//! ```
//!
//! ## Common event builders
//!
//! ```no_run
//! use core::num::ParseIntError;
//! use exceptionless::ExceptionlessClient;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let client = ExceptionlessClient::with_api_key("YOUR_API_KEY");
//!
//! let parse_error: ParseIntError = "not a number".parse::<i32>().unwrap_err();
//! client
//! .error(&parse_error)
//! .tag("parsing")
//! .source("user_input")
//! .data("raw_value", "not a number")
//! .send()
//! .await?;
//!
//! client
//! .feature("export_to_pdf")
//! .user_identity("user@example.com")
//! .version("1.2.3")
//! .send()
//! .await?;
//!
//! Ok(())
//! }
//! ```
//!
//! ## Custom server configuration
//!
//! ```no_run
//! use exceptionless::ExceptionlessClient;
//! use exceptionless::config::ClientConfig;
//! use exceptionless::transport::http::HttpTransport;
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let config = ClientConfig::new("YOUR_API_KEY")
//! .with_server_url("https://your-exceptionless-server.com");
//!
//! let client = ExceptionlessClient::new(config, HttpTransport::default());
//! client.log("self-hosted ready").send().await?;
//! Ok(())
//! }
//! ```
//!
//! Disabling a [`config::ClientConfig`] with [`config::ClientConfig::with_enabled`] causes
//! submission to fail before the transport is invoked.
pub use ExceptionlessClient;
pub use ;
pub use FeatureUsageBuilder;
pub use LogEventBuilder;