Documentation ¶
Index ¶
- Constants
- Variables
- func HttpHandler() func(http.Handler) http.Handler
- func Output() io.Writer
- func Print(v ...interface{})
- func Printf(format string, v ...interface{})
- func SetLevel(level string) error
- func SetOutput(out io.Writer)
- func Write(p []byte) (n int, err error)
- type CompatibilityWrapper
- func (c CompatibilityWrapper) Debug(args ...interface{})
- func (c CompatibilityWrapper) Debugf(format string, args ...interface{})
- func (c CompatibilityWrapper) Debugln(args ...interface{})
- func (c CompatibilityWrapper) Error(args ...interface{})
- func (c CompatibilityWrapper) Errorf(format string, args ...interface{})
- func (c CompatibilityWrapper) Errorln(args ...interface{})
- func (c CompatibilityWrapper) Fatal(args ...interface{})
- func (c CompatibilityWrapper) Fatalf(format string, args ...interface{})
- func (c CompatibilityWrapper) Fatalln(args ...interface{})
- func (c CompatibilityWrapper) Info(args ...interface{})
- func (c CompatibilityWrapper) Infof(format string, args ...interface{})
- func (c CompatibilityWrapper) Infoln(args ...interface{})
- func (c CompatibilityWrapper) Print(v ...interface{})
- func (c CompatibilityWrapper) Printf(format string, v ...interface{})
- func (c CompatibilityWrapper) Println(v ...interface{})
- func (c CompatibilityWrapper) V(level int) bool
- func (c CompatibilityWrapper) Warning(args ...interface{})
- func (c CompatibilityWrapper) Warningf(format string, args ...interface{})
- func (c CompatibilityWrapper) Warningln(args ...interface{})
- type Console
- type Event
- func (e *Event) AnErr(key string, err error) *Event
- func (e *Event) Array(key string, arr zerolog.LogArrayMarshaler) *Event
- func (e *Event) Bool(key string, b bool) *Event
- func (e *Event) Bools(key string, b []bool) *Event
- func (e *Event) Bytes(key string, val []byte) *Event
- func (e *Event) Caller(skip ...int) *Event
- func (e *Event) Callers() *Event
- func (e *Event) Dict(key string, dict *Event) *Event
- func (e *Event) Dur(key string, d time.Duration) *Event
- func (e *Event) Durs(key string, d []time.Duration) *Event
- func (e *Event) EmbedObject(obj zerolog.LogObjectMarshaler) *Event
- func (e *Event) Err(err error) *Event
- func (e *Event) Errs(key string, errs []error) *Event
- func (e *Event) Float32(key string, f float32) *Event
- func (e *Event) Float64(key string, f float64) *Event
- func (e *Event) Floats32(key string, f []float32) *Event
- func (e *Event) Floats64(key string, f []float64) *Event
- func (e *Event) Heap() *Event
- func (e *Event) Hex(key string, val []byte) *Event
- func (e *Event) IPAddr(key string, ip net.IP) *Event
- func (e *Event) IPPrefix(key string, pfx net.IPNet) *Event
- func (e *Event) Int(key string, i int) *Event
- func (e *Event) Int16(key string, i int16) *Event
- func (e *Event) Int32(key string, i int32) *Event
- func (e *Event) Int64(key string, i int64) *Event
- func (e *Event) Int8(key string, i int8) *Event
- func (e *Event) Interface(key string, i interface{}) *Event
- func (e *Event) Ints(key string, i []int) *Event
- func (e *Event) Ints16(key string, i []int16) *Event
- func (e *Event) Ints32(key string, i []int32) *Event
- func (e *Event) Ints64(key string, i []int64) *Event
- func (e *Event) Ints8(key string, i []int8) *Event
- func (e *Event) MACAddr(key string, ha net.HardwareAddr) *Event
- func (e *Event) Msg(msg string)
- func (e *Event) Msgf(format string, v ...interface{})
- func (e *Event) Object(key string, obj zerolog.LogObjectMarshaler) *Event
- func (e *Event) RawJSON(key string, b []byte) *Event
- func (e *Event) Send()
- func (e *Event) Str(key, val string) *Event
- func (e *Event) Stringer(key string, val fmt.Stringer) *Event
- func (e *Event) Strs(key string, vals []string) *Event
- func (e *Event) Tag(names ...string) *Event
- func (e *Event) Time(key string, t time.Time) *Event
- func (e *Event) TimeDiff(key string, t time.Time, start time.Time) *Event
- func (e *Event) Times(key string, t []time.Time) *Event
- func (e *Event) Timestamp() *Event
- func (e *Event) Uint(key string, i uint) *Event
- func (e *Event) Uint16(key string, i uint16) *Event
- func (e *Event) Uint32(key string, i uint32) *Event
- func (e *Event) Uint64(key string, i uint64) *Event
- func (e *Event) Uint8(key string, i uint8) *Event
- func (e *Event) Uints(key string, i []uint) *Event
- func (e *Event) Uints16(key string, i []uint16) *Event
- func (e *Event) Uints32(key string, i []uint32) *Event
- func (e *Event) Uints64(key string, i []uint64) *Event
- func (e *Event) Uints8(key string, i []uint8) *Event
- type LogLevel
- type Wrapper
- func (w Wrapper) Compatibility() CompatibilityWrapper
- func (w Wrapper) Debug() *Event
- func (w Wrapper) Error() *Event
- func (w Wrapper) Fatal() *Event
- func (w Wrapper) Info() *Event
- func (w Wrapper) Level(lvl LogLevel) Wrapper
- func (w Wrapper) Panic() *Event
- func (w Wrapper) Print(v ...interface{})
- func (w Wrapper) Printf(format string, v ...interface{})
- func (w Wrapper) Trace() *Event
- func (w Wrapper) Warn() *Event
- func (w Wrapper) Write(p []byte) (n int, err error)
Constants ¶
View Source
const ( None = 0 Black = 30 Red = 31 Green = 32 Yellow = 33 Blue = 34 Magenta = 35 Cyan = 36 White = 37 Gray = 90 ColorCaller = Gray ColorMessage = None ColorFieldName = Cyan ColorFieldValue = None )
View Source
const ( EnvLevel = "FS_LOG_LEVEL" EnvOutput = "FS_LOG_OUTPUT" EnvNoColor = "FS_LOG_NOCOLOR" EnvJson = "FS_LOG_JSON" EnvNoTime = "FS_LOG_NOTIME" )
Variables ¶
View Source
var Writer = &Console{ Parts: []string{ zerolog.TimestampFieldName, zerolog.LevelFieldName, "tags", zerolog.CallerFieldName, zerolog.MessageFieldName, zerolog.ErrorFieldName, }, NoColor: os.Getenv(EnvNoColor) != "", NoTime: os.Getenv(EnvNoTime) != "", Out: Output(), }
Functions ¶
Types ¶
type CompatibilityWrapper ¶
type CompatibilityWrapper struct {
// contains filtered or unexported fields
}
func Compatibility ¶
func Compatibility() CompatibilityWrapper
func (CompatibilityWrapper) Debugf ¶
func (c CompatibilityWrapper) Debugf(format string, args ...interface{})
func (CompatibilityWrapper) Debugln ¶
func (c CompatibilityWrapper) Debugln(args ...interface{})
func (CompatibilityWrapper) Errorf ¶
func (c CompatibilityWrapper) Errorf(format string, args ...interface{})
func (CompatibilityWrapper) Errorln ¶
func (c CompatibilityWrapper) Errorln(args ...interface{})
func (CompatibilityWrapper) Fatalf ¶
func (c CompatibilityWrapper) Fatalf(format string, args ...interface{})
func (CompatibilityWrapper) Fatalln ¶
func (c CompatibilityWrapper) Fatalln(args ...interface{})
func (CompatibilityWrapper) Infof ¶
func (c CompatibilityWrapper) Infof(format string, args ...interface{})
func (CompatibilityWrapper) Infoln ¶
func (c CompatibilityWrapper) Infoln(args ...interface{})
func (CompatibilityWrapper) Printf ¶
func (c CompatibilityWrapper) Printf(format string, v ...interface{})
func (CompatibilityWrapper) Println ¶
func (c CompatibilityWrapper) Println(v ...interface{})
func (CompatibilityWrapper) V ¶
func (c CompatibilityWrapper) V(level int) bool
level (used by gRPC)
func (CompatibilityWrapper) Warning ¶
func (c CompatibilityWrapper) Warning(args ...interface{})
warning
func (CompatibilityWrapper) Warningf ¶
func (c CompatibilityWrapper) Warningf(format string, args ...interface{})
func (CompatibilityWrapper) Warningln ¶
func (c CompatibilityWrapper) Warningln(args ...interface{})
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
func (*Event) EmbedObject ¶
func (e *Event) EmbedObject(obj zerolog.LogObjectMarshaler) *Event
type Wrapper ¶
type Wrapper struct {
// contains filtered or unexported fields
}
func (Wrapper) Compatibility ¶
func (w Wrapper) Compatibility() CompatibilityWrapper
func (Wrapper) Print ¶
func (w Wrapper) Print(v ...interface{})
Print sends a log event using debug level and no extra field.
Click to show internal directories.
Click to hide internal directories.