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 ¶
- Variables
- func Fatal(v ...interface{})
- func Fatalf(format string, v ...interface{})
- func Init()
- func Panic(v ...interface{})
- func Panicf(format string, v ...interface{})
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func SetLogger(logger *log.Logger)
- func Write(w io.Writer, content []byte) error
- type Target
- func (t *Target) Fatal(v ...interface{})
- func (t *Target) Fatalf(format string, v ...interface{})
- func (t *Target) Panic(v ...interface{})
- func (t *Target) Panicf(format string, v ...interface{})
- func (t *Target) Print(v ...interface{})
- func (t *Target) Printf(format string, v ...interface{})
- func (t *Target) SetLogger(l *log.Logger)
Constants ¶
This section is empty.
Variables ¶
View Source
var DefaultTarget = new(Target)
Functions ¶
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf is a wrapper for DefaultTarget.Fatalf.
func Panicf ¶
func Panicf(format string, v ...interface{})
Panicf is a wrapper for DefaultTarget.Panicf.
func Printf ¶
func Printf(format string, v ...interface{})
Printf is a wrapper for DefaultTarget.Printf.
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) Panic ¶
func (t *Target) Panic(v ...interface{})
Panic is equivalent to Print() followed by panic().
func (*Target) Print ¶
func (t *Target) Print(v ...interface{})
Print is similar to fmt.Print, writing the given values to the Target logger.
Click to show internal directories.
Click to hide internal directories.