logtest

package
v0.16.7 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 3 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

Overview

Package logtest provides a cosmossdk.io/log.Logger that records entries for assertions in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Entry

type Entry struct {
	Level string
	Msg   string
	KV    map[string]any
}

Entry is one recorded log call. KV holds the call's key/values merged over the context added with With.

type Recorder

type Recorder struct {
	// contains filtered or unexported fields
}

Recorder records log entries. Loggers derived with With share the same store.

func New

func New() *Recorder

New returns an empty Recorder.

func (*Recorder) Debug

func (r *Recorder) Debug(msg string, keyVals ...any)

func (*Recorder) Entries

func (r *Recorder) Entries() []Entry

Entries returns a copy of all recorded entries in call order.

func (*Recorder) Error

func (r *Recorder) Error(msg string, keyVals ...any)

func (*Recorder) Impl

func (r *Recorder) Impl() any

Impl returns the recorder itself.

func (*Recorder) Info

func (r *Recorder) Info(msg string, keyVals ...any)

func (*Recorder) Warn

func (r *Recorder) Warn(msg string, keyVals ...any)

func (*Recorder) With

func (r *Recorder) With(keyVals ...any) log.Logger

With returns a Recorder sharing this recorder's store with additional context.

Jump to

Keyboard shortcuts

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