Documentation ¶
Overview ¶
Copyright 2014 tsuru authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
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.
Copyright 2014 tsuru authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
Index ¶
- Variables
- func Debug(v string)
- func Debugf(format string, v ...interface{})
- func Error(v string)
- func Errorf(format string, v ...interface{})
- func Fatal(v string)
- func Fatalf(format string, v ...interface{})
- func GetStdLogger() *log.Logger
- func Init()
- func SetLogger(logger Logger)
- func Write(w io.Writer, content []byte) error
- type Logger
- type Target
- func (t *Target) Debug(v string)
- func (t *Target) Debugf(format string, v ...interface{})
- func (t *Target) Error(v string)
- func (t *Target) Errorf(format string, v ...interface{})
- func (t *Target) Fatal(v string)
- func (t *Target) Fatalf(format string, v ...interface{})
- func (t *Target) GetStdLogger() *log.Logger
- func (t *Target) SetLogger(l Logger)
Constants ¶
This section is empty.
Variables ¶
var DefaultTarget = new(Target)
Functions ¶
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf is a wrapper for DefaultTarget.Debugf.
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf is a wrapper for DefaultTarget.Errorf.
func Fatalf ¶
func Fatalf(format string, v ...interface{})
Fatalf is a wrapper for DefaultTarget.Errorf.
func GetStdLogger ¶
GetStdLogger is a wrapper for DefaultTarget.GetStdLogger.
Types ¶
type Logger ¶
type Logger interface { Error(string) Errorf(string, ...interface{}) Fatal(string) Fatalf(string, ...interface{}) Debug(string) Debugf(string, ...interface{}) GetStdLogger() *log.Logger }
func NewFileLogger ¶
func NewSyslogLogger ¶
type Target ¶
type Target struct {
// contains filtered or unexported fields
}
Target is the current target for the log package.
func (*Target) GetStdLogger ¶
GetStdLogger returns a standard Logger instance useful for configuring log in external packages.