Documentation ¶
Index ¶
- Constants
- func RmColorFlags(flag int) int
- func SetColors(cls []int)
- func Stack(v ...interface{}) string
- type Logger
- func (l *Logger) Debug(ctx context.Context, msg string, fields ...zapcore.Field)
- func (l *Logger) Error(ctx context.Context, msg string, err error, fields ...zapcore.Field)
- func (l *Logger) Fatal(ctx context.Context, msg string, fields ...zapcore.Field)
- func (l *Logger) Flags() int
- func (l *Logger) GetLevel() int8
- func (l *Logger) Info(ctx context.Context, msg string, fields ...zapcore.Field)
- func (l *Logger) Location() *time.Location
- func (l *Logger) Panic(ctx context.Context, msg string, fields ...zapcore.Field)
- func (l *Logger) Prefix() string
- func (l *Logger) SetFlags(flag int)
- func (l *Logger) SetLevel(level int8)
- func (l *Logger) SetLocation(loc *time.Location)
- func (l *Logger) SetPrefix(prefix string)
- func (l *Logger) Stat() (stats []int64)
- func (l *Logger) Warn(ctx context.Context, msg string, fields ...zapcore.Field)
Constants ¶
View Source
const ( // Bits 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). A colon appears after these items: // 2009/0123 01:23:23.123123 /a/b/c/d.go:23: message Ldate = 1 << iota // the date: 2009/0123 Ltime // the time: 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 Lmodule // module name Llevel // level: 0(Debug), 1(Info), 2(Warn), 3(Error), 4(Panic), 5(Fatal) Llongcolor // color will start [info] end of line Lshortcolor // color only include [info] LstdFlags = Ldate | Ltime // initial values for the standard logger )
These flags define which text to prefix to each log entry generated by the Logger.
View Source
const ( ForeBlack = iota + 30 //30 ForeRed //31 ForeGreen //32 ForeYellow //33 ForeBlue //34 ForePurple //35 ForeCyan //36 ForeWhite //37 )
View Source
const ( BackBlack = iota + 40 //40 BackRed //41 BackGreen //42 BackYellow //43 BackBlue //44 BackPurple //45 BackCyan //46 BackWhite //47 )
View Source
const (
Lall = iota
)
Variables ¶
This section is empty.
Functions ¶
func RmColorFlags ¶
Types ¶
type Logger ¶
type Logger struct { Level int8 // contains filtered or unexported fields }
A Logger represents an active logging object that generates lines of output to an io.Writer. Each logging operation makes a single call to the Writer's Write method. A Logger can be used simultaneously from multiple goroutines; it guarantees to serialize access to the Writer.
func (*Logger) SetLocation ¶
Click to show internal directories.
Click to hide internal directories.