discard

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

README

The Discard Backend for Deck

The discard backend allows log messages to be discarded.

If logs are processed with no backends attached, deck will throw warnings. Attaching the discard backend satisfies the need to have at least one backend registered without actually sending log messages anywhere.

The discard backend supports all platforms.

Init

The discard backend does not take any setup parameters.

Attributes

The discard backend does not utilize any custom attributes.

Usage

import (
  github.com/google/deck
  github.com/google/deck/backends/discard
)

...
func main() {
  // silence log events
  deck.Add(discard.Init())
}

Documentation

Overview

Package discard provides a deck backend that discards all logs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Discard

type Discard struct{}

Discard is a log deck backend that simply discards messages. It satisfies the need to have at least one backend registered with deck in situations where you want to avoid any actual output.

func Init

func Init() *Discard

Init initializes the discard backend for use in a deck.

func (*Discard) Close

func (d *Discard) Close() error

Close closes the discard backend.

func (*Discard) New

func (d *Discard) New(lvl deck.Level, msg string) deck.Composer

New creates a new discard message.

Jump to

Keyboard shortcuts

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