asimov_module/
lib.rs

1// This is free and unencumbered software released into the public domain.
2
3#![no_std]
4#![forbid(unsafe_code)]
5
6extern crate alloc;
7
8#[cfg(feature = "std")]
9extern crate std;
10
11pub use dogma::prelude;
12
13#[cfg(feature = "cli")]
14pub use clientele::{SysexitsError, SysexitsResult, args_os, dotenv, exit};
15
16#[cfg(feature = "std")]
17pub use getenv;
18
19pub use secrecy;
20
21#[cfg(not(feature = "tracing"))]
22pub mod tracing;
23
24#[cfg(feature = "tracing")]
25pub use tracing;
26
27#[cfg(feature = "tracing")]
28pub use tracing_subscriber;
29
30#[cfg(all(feature = "std", feature = "cli", feature = "tracing"))]
31pub fn init_tracing_subscriber(
32    options: &clientele::StandardOptions,
33) -> Result<(), alloc::boxed::Box<(dyn core::error::Error + Send + Sync + 'static)>> {
34    extern crate std;
35    tracing_subscriber::fmt()
36        .with_writer(std::io::stderr)
37        .with_max_level(options)
38        .with_level(options.debug || options.verbose > 0)
39        .with_target(options.debug)
40        .with_file(false)
41        .without_time()
42        .try_init()
43}
44
45pub mod models;
46
47pub mod resolve;