surreal_sync_runtime/init.rs
1//! Process init shared by the CLI and embed entrypoints.
2
3use rustls::crypto::CryptoProvider;
4
5/// Install the TLS crypto provider and initialize tracing.
6///
7/// Called automatically by `from-*` `run` / `run::<Sink>` entrypoints. Call this
8/// yourself if you use lower-level `run_sync(&sink, …)` APIs directly.
9pub fn init() {
10 if let Err(err) = CryptoProvider::install_default(rustls::crypto::aws_lc_rs::default_provider())
11 {
12 eprintln!("Error setting up crypto provider for TLS: {err:?}");
13 }
14
15 tracing_subscriber::fmt()
16 .with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
17 .init();
18}