loggingtest

package
v1.13.2 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package loggingtest provides functions to test the content of the logs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Hook

type Hook struct {
	*test.Hook
}

Hook is a hook designed for dealing with logs in test scenarios. It wraps logrus/hooks/test.Hook.

func NewNullLogger

func NewNullLogger() (*logrus.Logger, *Hook)

NewNullLogger creates a discarding logger and installs the test hook.

func (*Hook) GetAllLogs

func (hook *Hook) GetAllLogs() string

GetAllLogs returns all the logs collected by the hook as a string.

func (*Hook) GetAllStructuredLogs

func (hook *Hook) GetAllStructuredLogs() string

GetAllStructuredLogs returns all the structured logs collected by the hook as a string.

Jump to

Keyboard shortcuts

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