Documentation ¶
Index ¶
- Constants
- func Black(message string) string
- func BlackBold(message string) string
- func Blue(message string) string
- func BlueBold(message string) string
- func Bold(message string) string
- func Cyan(message string) string
- func CyanBold(message string) string
- func Gray(message string) string
- func GrayBold(message string) string
- func Green(message string) string
- func GreenBold(message string) string
- func Magenta(message string) string
- func MagentaBold(message string) string
- func NewLevelWriter(l LEVEL) io.Writer
- func NewRotateWriter(dirName string, maxSize int64, flag int, perm os.FileMode) io.Writer
- func Red(message string) string
- func RedBold(message string) string
- func White(message string) string
- func WhiteBold(message string) string
- func Yellow(message string) string
- func YellowBold(message string) string
- type FormatFunc
- type Journal
- func (j *Journal) AddTransports(transports ...*Transport) *Journal
- func (j *Journal) Debug(format string, a ...interface{})
- func (j *Journal) Error(format string, a ...interface{})
- func (j *Journal) Info(format string, a ...interface{})
- func (j *Journal) Init(init func(*Journal)) *Journal
- func (j *Journal) SetFlags(flag int)
- func (j *Journal) Silly(format string, a ...interface{})
- func (j *Journal) Verbose(format string, a ...interface{})
- func (j *Journal) Warn(format string, a ...interface{})
- type LEVEL
- type LevelWriter
- type MutiWriter
- type RotateWriter
- type Transport
Constants ¶
const ( Ldate = 1 << iota // the date in the local time zone: 2009/01/23 Ltime // the time in the local time zone: 01:23:23 Lmicroseconds // microsecond resolution: 01:23:23.123123. assumes Ltime. Llongfile // full file name and line number: /a/b/c/d.go:23 Lshortfile // final file name element and line number: d.go:23. overrides Llongfile LUTC // if Ldate or Ltime is set, use UTC rather than the local time zone LstdFlags = Ldate | Ltime // initial values for the standard logger )
These flags define which text to prefix to each log entry generated by the Logger. Bits are or'ed together to control what's printed. There is no control over the order they appear (the order listed here) or the format they present (as described in the comments). The prefix is followed by a colon only when Llongfile or Lshortfile is specified. For example, flags Ldate | Ltime (or LstdFlags) produce,
2009/01/23 01:23:23 message
while flags Ldate | Ltime | Lmicroseconds | Llongfile produce,
2009/01/23 01:23:23.123123 /a/b/c/d.go:23: message
Variables ¶
This section is empty.
Functions ¶
func MagentaBold ¶
MagentaBold returns a magenta Bold string
func NewLevelWriter ¶
NewLevelWriter defined return a level writer
func NewRotateWriter ¶
NewRotateWriter defined return a rotate writer
Types ¶
type Journal ¶
type Journal struct {
// contains filtered or unexported fields
}
Journal logger
func CreateLogger ¶
func CreateLogger(level LEVEL, format FormatFunc, transports []*Transport) *Journal
CreateLogger logger
func (*Journal) AddTransports ¶
AddTransports defined append transports
type LevelWriter ¶
LevelWriter defined level writer
type MutiWriter ¶
type MutiWriter struct { Level LEVEL // contains filtered or unexported fields }
MutiWriter write with level
type RotateWriter ¶
RotateWriter rotate file
type Transport ¶
Transport for Journal
func NewFileTransport ¶
NewFileTransport defined FileTransport
func NewPrintTransport ¶
NewPrintTransport defined PrintTransport