MCPcopy
hub / github.com/tailscale/tailscale / PanicOnLog

Function PanicOnLog

tstest/log.go:58–60  ·  view source on GitHub ↗

PanicOnLog modifies the standard library log package's default output to an io.Writer that panics, to root out code that's not plumbing their logging through explicit tailscale.com/logger.Logf paths.

()

Source from the content-addressed store, hash-verified

56// an io.Writer that panics, to root out code that's not plumbing their logging
57// through explicit tailscale.com/logger.Logf paths.
58func PanicOnLog() {
59 log.SetOutput(panicLogWriter{})
60}
61
62// NewLogLineTracker produces a LogLineTracker wrapping a given logf that tracks whether expectedFormatStrings were seen.
63func NewLogLineTracker(logf logger.Logf, expectedFormatStrings []string) *LogLineTracker {

Callers 13

TestNewConnFunction · 0.92
TestPickDERPFallbackFunction · 0.92
TestDeviceStartStopFunction · 0.92
TestDiscokeyChangeFunction · 0.92
testActiveDiscoveryFunction · 0.92
testTwoDevicePingFunction · 0.92
TestMaybeRebindOnErrorFunction · 0.92
TestPrefsEqualFunction · 0.92
TestBasicPrefsFunction · 0.92
TestPrefsPersistFunction · 0.92
TestMemoryStoreFunction · 0.92
TestFileStoreFunction · 0.92

Calls

no outgoing calls

Tested by 13

TestNewConnFunction · 0.74
TestPickDERPFallbackFunction · 0.74
TestDeviceStartStopFunction · 0.74
TestDiscokeyChangeFunction · 0.74
testActiveDiscoveryFunction · 0.74
testTwoDevicePingFunction · 0.74
TestMaybeRebindOnErrorFunction · 0.74
TestPrefsEqualFunction · 0.74
TestBasicPrefsFunction · 0.74
TestPrefsPersistFunction · 0.74
TestMemoryStoreFunction · 0.74
TestFileStoreFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…