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
//! Human-facing output on stderr, routed through `tracing`.
//!
//! Nothing here touches stdout. Keeping the two channels in separate modules
//! is what makes "diagnostics on stderr, payload on stdout" checkable by
//! reading a file name instead of auditing call sites.
/// Logs `msg` as a structured `tracing::info!` event (does not write to stdout).
/// v1.0.89: suppressed when stderr is not a terminal (pipe) to avoid
/// polluting JSON pipelines when the user redirects stderr with `2>&1`.
/// Emits a bilingual progress message honouring `--lang` or XDG `i18n.lang`.
/// v1.0.89: suppressed when stderr is not a terminal (pipe).
/// Emits a localised error message to stderr via the `tracing` subscriber.
///
/// ADR-0047 / BUG-12 v1.0.88: prior implementation also called `eprintln!`
/// which produced a SECOND stderr line (Error:/Erro: prefix) for the same
/// error, on top of the structured `tracing::error!` line. Operators and
/// log parsers observed duplicated stderr lines.
///
/// The tracing subscriber is configured for stderr at `main.rs:115`, so a
/// single `tracing::error!` call already produces the human-readable line.
/// Callers that want a plain stderr line without tracing (e.g. one-shot
/// scripts) should use `eprintln!` directly instead of this helper.
///
/// Centralises human-readable error output following Pattern 5
/// ([`crate::output`] is the SOLE I/O point of the CLI).
/// Emits a bilingual error to stderr honouring `--lang` or XDG `i18n.lang`.
/// Usage: `output::emit_error_i18n("invariant violated", "invariante violado")`.