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. This is the mechanism behind plan ยง4.8:
//! the C++ side's per-category environment switches (`DRM_ALLOC_DEBUG`,
//! `DRM_EXT_DMABUF_DEBUG`) โ thresholds that are deliberately *not* vetoed by
//! the global level โ map onto `tracing`'s per-target directives natively.
//! `RUST_LOG=drmkit_planes::alloc=trace` is the drmkit spelling of
//! `DRM_ALLOC_DEBUG=1`.
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.