feat(mobile): отключаемый кольцевой буфер логов

Хосту, который ведёт лог через EventSink, кольцо для DumpLogs не нужно.
This commit is contained in:
samosvalishe committed 2026-09-19 23:54:42 +03:00
1 parent 4865a73b5f
commit a7ec2b949a
4 files changed
+37 -1

No files matched your search

+3 -1
View File
@@ -68,7 +68,9 @@ type sinkLogger struct {
func (l *sinkLogger) write(level, format string, v ...any) {
msg := fmt.Sprintf(format, v...)
now := time.Now()
l.buf.append(now.Format("15:04:05") + " [" + level + "] " + msg)
if !logBufOff.Load() {
l.buf.append(now.Format("15:04:05") + " [" + level + "] " + msg)
}
if s := currentSink(); s != nil {
s.OnLog(level, msg, now.UnixMilli())
}