package log import "sync" // ShareLog writes share result lines to an append-only text file. // // Line format (accept): 2026-04-04T12:00:00Z ACCEPT diff= latency=ms // Line format (reject): 2026-04-04T12:00:00Z REJECT reason="" // // sl := log.NewShareLog("/var/log/proxy-shares.log") // bus.Subscribe(proxy.EventAccept, sl.OnAccept) // bus.Subscribe(proxy.EventReject, sl.OnReject) type ShareLog struct { path string mu sync.Mutex // f is opened append-only on first write; nil until first event. // Uses core.File for I/O abstraction. }