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
//! Simple initialization functions for JACS observability.
//!
//! This module provides two entry points:
//!
//! - [`init_logging()`] — Quick stderr logging with sensible defaults.
//! Uses `RUST_LOG` for customization, defaults to `jacs=info`.
//!
//! - [`init_tracing()`] — Full tracing subscriber setup (stderr output).
//! For OTLP export, use [`super::init_observability()`] with a
//! [`TracingConfig`] that has `enabled: true` and the appropriate
//! `otlp-tracing` feature flag.
//!
//! # Examples
//!
//! ```rust,ignore
//! use jacs::observability::init::{init_logging, init_tracing};
//!
//! // Quick start — stderr logging only
//! init_logging();
//!
//! // Or full tracing subscriber
//! init_tracing();
//! ```
use io;
use ;
/// Initialize logging with sensible defaults.
///
/// Sets up a `tracing-subscriber` that:
/// - Outputs to **stderr**
/// - Defaults to `info` level for JACS modules
/// - Reads `RUST_LOG` environment variable for customization
/// - Suppresses verbose output from networking crates (hyper, tonic, h2, reqwest)
///
/// Safe to call multiple times — subsequent calls are no-ops if a global
/// subscriber is already set.
///
/// # Environment Variables
///
/// - `RUST_LOG`: Standard Rust log filter. Defaults to `jacs=info` if unset.
/// Examples: `RUST_LOG=debug`, `RUST_LOG=jacs=trace,jacs::crypt=debug`
/// Initialize a full tracing subscriber with stderr output.
///
/// Sets up `tracing-subscriber` with:
/// - `EnvFilter` respecting `RUST_LOG` (defaults to `jacs=info`)
/// - Formatted output to stderr with ANSI colors
/// - Suppressed networking crate noise
///
/// This does **not** enable OTLP export. For OTLP tracing, use
/// [`super::init_observability()`] with the `otlp-tracing` feature enabled.
///
/// Safe to call multiple times — subsequent calls are no-ops.