MCPcopy
hub / github.com/keploy/keploy / swap

Method swap

utils/log/logger.go:406–412  ·  view source on GitHub ↗

swap atomically replaces the inner WriteSyncer and resets the cap counters. Called by DebugFileSink.Swap after the upstream buffer has been flushed; bytes written before swap are guaranteed to land in the OLD inner because this method holds the write mutex.

(inner zapcore.WriteSyncer)

Source from the content-addressed store, hash-verified

404// been flushed; bytes written before swap are guaranteed to land in
405// the OLD inner because this method holds the write mutex.
406func (s *cappedWriteSyncer) swap(inner zapcore.WriteSyncer) {
407 s.mu.Lock()
408 defer s.mu.Unlock()
409 s.inner = inner
410 s.written.Store(0)
411 s.capped.Store(false)
412}
413
414// DebugFileSink is the caller-side handle for the debug-level file sink
415// attached by AddDebugFileSink. It owns the buffered + capped writer

Callers 2

SwapMethod · 0.80
RotateForScopeMethod · 0.80

Calls 1

StoreMethod · 0.45

Tested by

no test coverage detected