ckb_sentry_core/
lib.rs

1//! This crate provides the core of the [Sentry](https://sentry.io/) SDK, which
2//! can be used to log events and errors.
3//!
4//! This crate is meant for integration authors and third party library authors
5//! that want to instrument their code for sentry.
6//!
7//! Regular users who wish to integrate sentry into their applications should
8//! rather use the [`sentry`] crate, which comes with a default transport, and
9//! a large set of integrations for various third-party libraries.
10//!
11//! # Core Concepts
12//!
13//! This crate follows the [Unified API] guidelines and is centered around
14//! the concepts of [`Client`], [`Hub`] and [`Scope`], as well as the extension
15//! points via the [`Integration`], [`Transport`] and [`TransportFactory`] traits.
16//!
17//! # Minimal API
18//!
19//! By default, this crate comes with a so-called "minimal" mode. This mode will
20//! provide all the APIs needed to instrument code with sentry, and to write
21//! sentry integrations, but it will blackhole a lot of operations.
22//!
23//! In minimal mode some types are restricted in functionality. For instance
24//! the [`Client`] is not available and the [`Hub`] does not retain all API
25//! functionality.
26//!
27//! # Features
28//!
29//! * `feature = "client"`: Activates the [`Client`] type and certain
30//!   [`Hub`] functionality.
31//! * `feature = "test"`: Activates the [`test`] module, which can be used to
32//!   write integration tests. It comes with a test transport which can capture
33//!   all sent events for inspection.
34//! * `feature = "debug-logs"`: Uses the `log` crate for debug output, instead
35//!   of printing to `stderr`. This feature is **deprecated** and will be
36//!   replaced by a dedicated log callback in the future.
37//!
38//! [`sentry`]: https://crates.io/crates/sentry
39//! [Unified API]: https://develop.sentry.dev/sdk/unified-api/
40//! [`Client`]: struct.Client.html
41//! [`Hub`]: struct.Hub.html
42//! [`Scope`]: struct.Scope.html
43//! [`Integration`]: trait.Integration.html
44//! [`Transport`]: trait.Transport.html
45//! [`TransportFactory`]: trait.TransportFactory.html
46//! [`test`]: test/index.html
47
48#![doc(html_favicon_url = "https://sentry-brand.storage.googleapis.com/favicon.ico")]
49#![doc(html_logo_url = "https://sentry-brand.storage.googleapis.com/sentry-glyph-black.png")]
50#![warn(missing_docs)]
51
52// macros; these need to be first to be used by other modules
53#[macro_use]
54mod macros;
55
56mod api;
57mod breadcrumbs;
58mod clientoptions;
59mod constants;
60mod error;
61mod futures;
62mod hub;
63mod integration;
64mod intodsn;
65mod scope;
66mod transport;
67
68// public api or exports from this crate
69pub use crate::api::*;
70pub use crate::breadcrumbs::IntoBreadcrumbs;
71pub use crate::clientoptions::ClientOptions;
72pub use crate::error::{capture_error, event_from_error, parse_type_from_debug};
73pub use crate::futures::{SentryFuture, SentryFutureExt};
74pub use crate::hub::Hub;
75pub use crate::integration::Integration;
76pub use crate::intodsn::IntoDsn;
77pub use crate::scope::{Scope, ScopeGuard};
78pub use crate::transport::{Transport, TransportFactory};
79
80// client feature
81#[cfg(feature = "client")]
82mod client;
83#[cfg(feature = "client")]
84mod session;
85#[cfg(feature = "client")]
86pub use crate::client::Client;
87
88// test utilities
89#[cfg(feature = "test")]
90pub mod test;
91
92// public api from other crates
93#[doc(inline)]
94pub use sentry_types as types;
95pub use sentry_types::protocol::v7 as protocol;
96pub use sentry_types::protocol::v7::{Breadcrumb, Envelope, Level, User};