mirror of
https://github.com/hackdiaz-dev/free-turn-proxy.git
synced 2026-10-12 09:41:53 +02:00
a7ec2b949a
Хосту, который ведёт лог через EventSink, кольцо для DumpLogs не нужно.
24 lines
476 B
Go
24 lines
476 B
Go
package mobile
|
|
|
|
import "testing"
|
|
|
|
func TestSetLogBufferOffSkipsRing(t *testing.T) {
|
|
t.Cleanup(func() { SetLogBuffer(true); ClearLogs() })
|
|
|
|
l := &sinkLogger{buf: sharedLogBuf}
|
|
SetLogBuffer(true)
|
|
l.Infof("kept")
|
|
if DumpLogs() == "" {
|
|
t.Fatal("ring must collect lines by default")
|
|
}
|
|
|
|
SetLogBuffer(false)
|
|
if DumpLogs() != "" {
|
|
t.Fatal("disabling must drop collected lines")
|
|
}
|
|
l.Infof("dropped")
|
|
if DumpLogs() != "" {
|
|
t.Fatal("disabled ring must stay empty")
|
|
}
|
|
}
|