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
// SPDX-FileCopyrightText: (c) 2026 Joel Winarske
// SPDX-License-Identifier: MIT
//! Bridge from the drmkit sink into [`tracing`].
//!
//! Enabled by the `tracing` feature. Everything arrives under the single
//! `drmkit` target, so `RUST_LOG=drmkit=debug` admits it. The per-category
//! environment switches (`DRM_ALLOC_DEBUG`, `DRM_EXT_DMABUF_DEBUG`) -- the
//! C++ side's thresholds, deliberately *not* vetoed by the global level --
//! still gate their channels: `tracing` filters what they emit, but does not
//! replace them.
use crate::;
/// Route every admitted record into `tracing` under the `drmkit` target.
///
/// Also raises the drmkit threshold to [`LogLevel::Debug`], because once
/// `tracing` owns filtering, a second threshold in front of it would silently
/// veto directives the consumer asked for — the exact failure the C++ channel
/// carve-out exists to avoid. Call [`set_log_level`] afterwards if a coarse
/// pre-filter is genuinely wanted.
///
/// Installing is idempotent in effect, though each call replaces the sink.
///
/// ```no_run
/// drmkit_log::install_tracing_sink();
/// ```
///
/// Marked `no_run`: this replaces the process-global sink and raises the
/// global threshold, so actually running it would perturb every other example
/// in the merged doctest binary. It is still compiled and type-checked.