SetDebugFileSink registers s as the package-wide active debug file sink. Subsequent calls to DebugFileSink() return s. Pass nil to clear. Used by main entrypoints to publish the sink so cross-package helpers (e.g. RotateDebugFileForTestSet) can reach it without an explicit dependency injection chain
(s *DebugFileSink)
| 617 | // helpers (e.g. RotateDebugFileForTestSet) can reach it without an |
| 618 | // explicit dependency injection chain. |
| 619 | func SetDebugFileSink(s *DebugFileSink) { |
| 620 | globalSink.Store(globalSinkHolder{s: s}) |
| 621 | } |
| 622 | |
| 623 | // GetDebugFileSink returns the package-wide active sink registered by |
| 624 | // SetDebugFileSink, or nil when none is registered. |