logtarget

package
v0.0.0-...-88649aa Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2012 License: BSD-3-Clause Imports: 3 Imported by: 0

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 struct {
	// contains filtered or unexported fields
}

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 Target LogTarget

func (*LogTarget) OpenFile

func (target *LogTarget) OpenFile(fn string) (err error)

OpenFile opens the main log file for writing. This method will open the file in append-only mode.

func (*LogTarget) Rotate

func (target *LogTarget) Rotate() error

Rotate rotates the current log file. This method holds a lock while rotating the log file, and all log writes will be held back until the rotation is complete.

func (*LogTarget) Write

func (target *LogTarget) Write(in []byte) (int, error)

Write writes a log message to all registered io.Writers

Jump to

Keyboard shortcuts

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