log

package
v0.0.0-...-5facc9d Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2013 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package log provides logging utility.

It abstracts the logger from the standard log package, allowing the developer to patck the logging target, changing this to a file, or syslog, for example.

Index

Constants

This section is empty.

Variables

View Source
var DefaultTarget = new(Target)

Functions

func Fatal

func Fatal(v ...interface{})

Fatal is a wrapper for DefaultTarget.Fatal.

func Fatalf

func Fatalf(format string, v ...interface{})

Fatalf is a wrapper for DefaultTarget.Fatalf.

func Init

func Init()

func Panic

func Panic(v ...interface{})

Panic is a wrapper for DefaultTarget.Panic.

func Panicf

func Panicf(format string, v ...interface{})

Panicf is a wrapper for DefaultTarget.Panicf.

func Print

func Print(v ...interface{})

Print is a wrapper for DefaultTarget.Print.

func Printf

func Printf(format string, v ...interface{})

Printf is a wrapper for DefaultTarget.Printf.

func SetLogger

func SetLogger(logger *log.Logger)

SetLogger is a wrapper for DefaultTarget.SetLogger.

func Write

func Write(w io.Writer, content []byte) error

Types

type Target

type Target struct {
	// contains filtered or unexported fields
}

Target is the current target for the log package.

func (*Target) Fatal

func (t *Target) Fatal(v ...interface{})

Fatal is equivalent to Print() followed by os.Exit(1).

func (*Target) Fatalf

func (t *Target) Fatalf(format string, v ...interface{})

Fatalf is equivalent to Printf followed by os.Exit(1).

func (*Target) Panic

func (t *Target) Panic(v ...interface{})

Panic is equivalent to Print() followed by panic().

func (*Target) Panicf

func (t *Target) Panicf(format string, v ...interface{})

func (*Target) Print

func (t *Target) Print(v ...interface{})

Print is similar to fmt.Print, writing the given values to the Target logger.

func (*Target) Printf

func (t *Target) Printf(format string, v ...interface{})

Printf is similar to fmt.Printf, writing the formatted string to the Target logger.

func (*Target) SetLogger

func (t *Target) SetLogger(l *log.Logger)

SetLogger defines a new logger for the current target.

See the builtin log package for more details.

Jump to

Keyboard shortcuts

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