package
0.0.0-20240721135326-6d6b7b811853
Repository: https://github.com/anywherelan/ts-dns.git
Documentation: pkg.go.dev

# Functions

AsJSON returns a formatter that formats v as JSON.
Ctx constructs a Context from ctx with fn as its custom log function.
Discard is a Logf that throws away the logs given to it.
Filtered returns a Logf that silently swallows some log lines.
FromContext extracts a log function from ctx.
FuncWriter returns an io.Writer that writes to f.
LogfCloser wraps logf to create a logger that can be closed.
LogOnChange logs a given line only if line != lastLine, or if maxInterval has passed since the last time this identical line was logged.
RateLimitedFn is a wrapper for RateLimitedFnWithClock that includes the current time automatically.
RateLimitedFnWithClock returns a rate-limiting Logf wrapping the given logf.
RusagePrefixLog returns a Logf func wrapping the provided logf func that adds a prefixed log message to each line with the current binary memory usage and max RSS.
SlowLoggerWithClock is a logger that applies rate limits similar to RateLimitedFnWithClock, but instead of dropping logs will sleep until they can be written.
StdLogger returns a standard library logger from a Logf.
TestLogger returns a logger that logs to tb.Logf with a prefix to make it easier to distinguish spam from explicit test failures.
WithPrefix wraps f, prefixing each format with the provided prefix.

# Variables

LogfKey stores and loads [Logf] values within a [context.Context].

# Structs

HTTPServerLogFilter is an io.Writer that can be used as the net/http.Server.ErrorLog logger, and will filter out noisy, low-signal messages that clutter up logs.

# Interfaces

TBLogger is the testing.TB subset needed by TestLogger.

# Type aliases

ArgWriter is a fmt.Formatter that can be passed to any Logf func to efficiently write to a %v argument without allocations.
A Context is a context.Context that should contain a custom log function, obtainable from FromContext.
Logf is the basic Tailscale logger type: a printf-like func.