Documentation ¶
Index ¶
- func Flush()
- type Context
- func (c Context) Any(key string, val interface{}) Context
- func (c Context) Bool(key string, val bool) Context
- func (c Context) Err(err error) Context
- func (c Context) Float32(key string, val float32) Context
- func (c Context) Float64(key string, val float64) Context
- func (c Context) Int(key string, val int) Context
- func (c Context) Int16(key string, val int16) Context
- func (c Context) Int32(key string, val int32) Context
- func (c Context) Int64(key string, val int64) Context
- func (c Context) Int8(key string, val int8) Context
- func (c Context) Ints(key string, val []int) Context
- func (c Context) Logger() *Logger
- func (c Context) StackTrace() Context
- func (c Context) Str(key string, val string) Context
- func (c Context) Strs(key string, val []string) Context
- func (c Context) Time(key string, val time.Time) Context
- func (c Context) Times(key string, val []time.Time) Context
- func (c Context) Uint(key string, val uint) Context
- func (c Context) Uint16(key string, val uint16) Context
- func (c Context) Uint32(key string, val uint32) Context
- func (c Context) Uint64(key string, val uint64) Context
- func (c Context) Uint8(key string, val uint8) Context
- type Entry
- func Debug() *Entry
- func DebugCtx(ctx context.Context) *Entry
- func Error() *Entry
- func ErrorCtx(ctx context.Context) *Entry
- func Fatal() *Entry
- func FatalCtx(ctx context.Context) *Entry
- func Info() *Entry
- func InfoCtx(ctx context.Context) *Entry
- func Panic() *Entry
- func PanicCtx(ctx context.Context) *Entry
- func Warn() *Entry
- func WarnCtx(ctx context.Context) *Entry
- func (e *Entry) Any(key string, val interface{}) *Entry
- func (e *Entry) Bool(key string, val bool) *Entry
- func (e *Entry) Duration(key string, val time.Duration) *Entry
- func (e *Entry) Err(err error) *Entry
- func (e *Entry) Fields() []*Field
- func (e *Entry) Float32(key string, val float32) *Entry
- func (e *Entry) Float64(key string, val float64) *Entry
- func (e *Entry) Int(key string, val int) *Entry
- func (e *Entry) Int16(key string, val int16) *Entry
- func (e *Entry) Int32(key string, val int32) *Entry
- func (e *Entry) Int64(key string, val int64) *Entry
- func (e *Entry) Int8(key string, val int8) *Entry
- func (e *Entry) Ints(key string, val []int) *Entry
- func (e *Entry) Msg(msg string)
- func (e *Entry) Msgf(msg string, v ...any)
- func (e *Entry) StackTrace() *Entry
- func (e *Entry) Str(key string, val string) *Entry
- func (e *Entry) Strs(key string, val []string) *Entry
- func (e *Entry) Time(key string, val time.Time) *Entry
- func (e *Entry) Times(key string, val []time.Time) *Entry
- func (e *Entry) Uint(key string, val uint) *Entry
- func (e *Entry) Uint16(key string, val uint16) *Entry
- func (e *Entry) Uint32(key string, val uint32) *Entry
- func (e *Entry) Uint64(key string, val uint64) *Entry
- func (e *Entry) Uint8(key string, val uint8) *Entry
- type Field
- type Flusher
- type Handler
- type HandlerOptions
- type JSONHandler
- type Level
- type Logger
- func (l *Logger) Debug() *Entry
- func (l *Logger) DebugCtx(ctx context.Context) *Entry
- func (l *Logger) Error() *Entry
- func (l *Logger) ErrorCtx(ctx context.Context) *Entry
- func (l *Logger) Fatal() *Entry
- func (l *Logger) FatalCtx(ctx context.Context) *Entry
- func (l *Logger) Info() *Entry
- func (l *Logger) InfoCtx(ctx context.Context) *Entry
- func (l *Logger) Panic() *Entry
- func (l *Logger) PanicCtx(ctx context.Context) *Entry
- func (l *Logger) Warn() *Entry
- func (l *Logger) WarnCtx(ctx context.Context) *Entry
- func (l *Logger) With() Context
- func (l *Logger) WithContext(ctx context.Context) context.Context
- type TextHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context use for meta data
func (Context) StackTrace ¶
StackTrace adds stack_trace field to the current context
type Entry ¶
type Entry struct { Logger *Logger Level Level `json:"level"` Message string `json:"message"` // contains filtered or unexported fields }
Entry defines a single log entry
func (*Entry) StackTrace ¶
StackTrace adds stack_trace field to the current context
type Flusher ¶
type Flusher interface {
Flush() error
}
Flusher is an interface that allow handles have the ability to clear buffer and close connection
type Handler ¶
type Handler interface { Enabled(context.Context, Level) bool Handle(context.Context, *Entry) error }
Handler is an interface that log handlers need to be implemented
type HandlerOptions ¶
type JSONHandler ¶
type JSONHandler struct {
// contains filtered or unexported fields
}
func NewJSONHandler ¶
func NewJSONHandler(w io.Writer, opts *HandlerOptions) *JSONHandler
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func FromContext ¶
FromContext return a logger from the standard context
type TextHandler ¶
type TextHandler struct {
// contains filtered or unexported fields
}
TextHandler is an instance of the text handler
func NewTextHandler ¶
func NewTextHandler(w io.Writer, opts *HandlerOptions) *TextHandler
New create a new Console instance
Source Files ¶
Click to show internal directories.
Click to hide internal directories.