logtarget

package
v0.0.0-...-6f8c2bf Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2020 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Overview

Package logtarget implements a multiplexing logging target

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type LogTarget

type LogTarget interface {
	io.Writer

	Rotate() error
}

LogTarget implements the io.Writer interface, allowing LogTarget to be registered with the regular Go log package. LogTarget multiplexes its incoming writes to multiple optional output writers, and one main output writer (the log file).

var Default LogTarget

Default is the default log target for the application It has to be initialized before used

func OpenFile

func OpenFile(fileName string, ws ...io.Writer) (t LogTarget, err error)

OpenFile creates a LogTarget pointing to a log file and returns it. This method will open the file in append-only mode. It also takes a variable number of writers that are other log targets

func OpenWriters

func OpenWriters(ws ...io.Writer) LogTarget

OpenWriters returns a log target that will log to all the given writers at the same time

Jump to

Keyboard shortcuts

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