logutil

package
v0.0.41 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSuppressWriter

func NewSuppressWriter(w io.Writer, suppress string) io.Writer

NewSuppressWriter returns an io.Writer that discards writes whose lines start with the given string.

Types

type SuppressWriter

type SuppressWriter struct {
	W        io.Writer
	Suppress string
}

SuppressWriter wraps an io.Writer and drops any Write that contains the suppression string. It is used to silence known-harmless log noise (e.g. Go's net/http "Unsolicited response received on idle HTTP channel" during Unity domain reloads).

func (*SuppressWriter) Write

func (s *SuppressWriter) Write(p []byte) (int, error)

Write implements io.Writer. It drops the write only if the suppression string appears at the start of a line (or the very start of p). This is stricter than bytes.Contains, which would accidentally suppress legitimate log lines that merely include the phrase elsewhere.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL