Documentation ¶
Index ¶
- Constants
- Variables
- func Debug(msg string)
- func Error(msg string)
- func Fatal(msg string)
- func Info(msg string)
- func InitGlobalLogger()
- func Set(key string, value interface{})
- func SetWithZC(fn func(zc ZC) ZC)
- func Trace(msg string)
- func Warn(msg string)
- func With() zerolog.Context
- type LogEntry
- func (x *LogEntry) Debug(msg string)
- func (x *LogEntry) E(err error) *LogEntry
- func (x *LogEntry) Error(msg string)
- func (x *LogEntry) Fatal(msg string)
- func (x *LogEntry) Info(msg string)
- func (x *LogEntry) Trace(msg string)
- func (x *LogEntry) V(key string, value interface{}) *LogEntry
- func (x *LogEntry) Warn(msg string)
- type Logger
- func (x *Logger) Debug(msg string)
- func (x *Logger) E(err error) *LogEntry
- func (x *Logger) Entry() *LogEntry
- func (x *Logger) Error(msg string)
- func (x *Logger) Fatal(msg string)
- func (x *Logger) Info(msg string)
- func (x *Logger) Set(key string, value interface{})
- func (x *Logger) SetWithZC(fn func(zc ZC) ZC)
- func (x *Logger) Trace(msg string)
- func (x *Logger) V(key string, value interface{}) *LogEntry
- func (x *Logger) Warn(msg string)
- func (x *Logger) With() zerolog.Context
- type Option
- type OptionFunc
- type ZC
Constants ¶
View Source
const DefaultDatetimeFormat = "2006-01-02T15:04:05.000000000Z07:00"
Variables ¶
View Source
var ( // GlobalLoggerOptions is gLogger configurations options. GlobalLoggerOptions []OptionFunc // nolint:gochecknoglobals )
Functions ¶
func Set ¶
func Set(key string, value interface{})
Set saves key and value to logger. The key and value are output permanently
Types ¶
type LogEntry ¶
type LogEntry struct {
// contains filtered or unexported fields
}
LogEntry is one record of logging.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provides basic logging functionality.
func NewWithOption ¶
func NewWithOption(opts ...OptionFunc) *Logger
NewWithOption returns a new Logger with options.
func (*Logger) Set ¶
Set saves key and value attribute to logger. The attribute are output permanently.
func (*Logger) SetWithZC ¶
SetWithZC saves key and value to logger. The key and value are output permanently
type OptionFunc ¶
type OptionFunc func(opt *Option)
func OptionConsoleWriter ¶
func OptionConsoleWriter() OptionFunc
OptionConsoleWriter returns an OptionFunc for configuring console format.
func OptionJSONWriter ¶
func OptionJSONWriter() OptionFunc
OptionJSONWriter returns an OptionFunc for configuring json format.
func OptionLevel ¶
func OptionLevel(level string) OptionFunc
OptionLevel returns an OptionFunc for configuring log levels.
func OptionWriter ¶
func OptionWriter(format string) OptionFunc
OptionWriter returns an OptionFunc for configuring log format.
Click to show internal directories.
Click to hide internal directories.