testutil

package
v1.54.2 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2026 License: Apache-2.0 Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Leveled added in v1.52.0

func Leveled(core zapcore.Core, enab zapcore.LevelEnabler) zapcore.Core

Leveled overrides a fixed-level core's level decisions with enab.

func NewJSONCore added in v1.52.0

func NewJSONCore(ws zapcore.WriteSyncer, enab zapcore.LevelEnabler) zapcore.Core

Types

type BufferedWriteSyncer

type BufferedWriteSyncer struct {
	bytes.Buffer
}

func (*BufferedWriteSyncer) Sync

func (t *BufferedWriteSyncer) Sync() error

func (*BufferedWriteSyncer) Unmarshal

func (t *BufferedWriteSyncer) Unmarshal(v any) error

type CoreFactory added in v1.52.0

type CoreFactory = func(enab zapcore.LevelEnabler) zapcore.Core

zaputil's own tests import this package, so it must not import zaputil; callers build the Tee themselves.

func NewJSONCoreFactory added in v1.52.0

func NewJSONCoreFactory(ws zapcore.WriteSyncer) CoreFactory

func NewObserverCoreFactory added in v1.52.0

func NewObserverCoreFactory() (CoreFactory, *observer.ObservedLogs)

NewObserverCoreFactory records every entry the core is handed.

type TestLogOutput

type TestLogOutput struct {
	Level  string
	TS     float64
	Caller string
	Msg    string
}

Jump to

Keyboard shortcuts

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