logger

package
v0.0.0-...-7838e69 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: Apache-2.0 Imports: 7 Imported by: 1 module, 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

This section is empty.

Types

type LogCapture

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

LogCapture allows testing code to query log output.

func NewLogCapture

func NewLogCapture() *LogCapture

NewLogCapture captures logs for querying.

func (*LogCapture) AssertHasEntry

func (c *LogCapture) AssertHasEntry(t *testing.T, msg string)

AssertHasEntry checks if there is a log entry with the given string.

func (*LogCapture) ClearEntries

func (c *LogCapture) ClearEntries()

ClearEntries removes all log entries.

func (*LogCapture) Entries

func (c *LogCapture) Entries() []string

Entries returns all log entries.

func (*LogCapture) Run

func (c *LogCapture) Run(e *zerolog.Event, level zerolog.Level, msg string)

Run is the hook to capture log entries. It also stops the entry from being printed.

Jump to

Keyboard shortcuts

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