mirror of
https://github.com/shadowsocks/ShadowsocksX-NG.git
synced 2026-11-08 10:54:50 +00:00
The root system-proxy helper logged nothing and launchd discards its stdout/stderr, leaving helper launches, connection refusals, GUI-side timeouts and root-side failures invisible. Share the minimal unified-log emission unit (SystemLog) across GUI, wrapper and helper, and add a dedicated closed helper event enum (lifecycle minimum: listener ready, connection accepted/rejected with peer pid, typed apply/clear results) with ADR-0045 privacy splitting. The emission seam is injected at the helper engine and listener for test doubles. Helper events are Console-only: no stderr, no agent.log, no diagnostic view or report surface (ADR-0047).
12 lines
328 B
Swift
12 lines
328 B
Swift
import Testing
|
|
|
|
@testable import ShadowsocksX_NG2
|
|
|
|
struct SystemLogSwitchTests {
|
|
@Test func systemLogIsDisabledOnlyByExplicitZero() {
|
|
#expect(SystemLog.isSystemLogEnabled([:]))
|
|
#expect(SystemLog.isSystemLogEnabled(["SSXNG_SYSTEM_LOG": "1"]))
|
|
#expect(!SystemLog.isSystemLogEnabled(["SSXNG_SYSTEM_LOG": "0"]))
|
|
}
|
|
}
|