testlog

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2022 License: MIT Imports: 3 Imported by: 0

README

testlog

Logging of sirkon/errors in tests, including context.

Installation

go get github.com/sirkon/errors

Usage

Just use helper functions:

testlog.Log(errors.New("log entry"))
testlog.Error(errors.New("some serious error"))

PS

Tests are meant to fail in this module.

Documentation

Overview

Package testlog context aware github.com/sirkon/errors.Error logging in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Check

func Check(t TestingPrinter, err error) bool

Check do nothing and return false if error is nil. Prints error and return true otherwise.

func Error

func Error(t TestingPrinter, err error)

Error signal error.

func Log

func Log(t TestingPrinter, err error)

Log logs error.

Types

type TestingPrinter

type TestingPrinter interface {
	Log(a ...any)
	Logf(format string, a ...any)
	Error(a ...any)
	Errorf(format string, a ...any)
}

TestingPrinter wrapper over *testing.T to print data

Jump to

Keyboard shortcuts

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