zap

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 12, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package zap wraps uber zap package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FastXLogger

type FastXLogger struct {
	// contains filtered or unexported fields
}

XLogger wraps zap Logger.

func NewFastXLogger

func NewFastXLogger(config xlogcore.Config) (*FastXLogger, error)

NewFastXLogger returns FastXLogger.

func (*FastXLogger) AddCallerSkip

func (log *FastXLogger) AddCallerSkip(n int) xlogcore.FastXLog

AddCallerSkip increases the number of callers skipped by caller annotation.

func (*FastXLogger) Debug

func (log *FastXLogger) Debug(msg string)

Debug construct and log a Debug message.

func (*FastXLogger) Error

func (log *FastXLogger) Error(msg string)

Error construct and log a Error message.

func (*FastXLogger) Fatal

func (log *FastXLogger) Fatal(msg string)

Fatal construct and log a Fatal message, then calls os.Exit(1).

func (*FastXLogger) FromCtx

func (log *FastXLogger) FromCtx(ctx context.Context) xlogcore.FastXLog

FromCtx gets the FastXLog from the ctx.

func (*FastXLogger) Info

func (log *FastXLogger) Info(msg string)

Info construct and log a Info message.

func (*FastXLogger) Panic

func (log *FastXLogger) Panic(msg string)

Panic construct and log a Panic message, then panics.

func (*FastXLogger) Sync

func (log *FastXLogger) Sync()

Sync flushes buffered logs. Users should call Sync before exiting.

func (*FastXLogger) ToCtx

func (log *FastXLogger) ToCtx(ctx context.Context, kvs ...xlogcore.KeyVal) context.Context

ToCtx adds the FastXLog, with a variadic number of fields, to ctx and returns the resulting context.Context.

func (*FastXLogger) Warn

func (log *FastXLogger) Warn(msg string)

Warn construct and log a Warn message.

func (*FastXLogger) With

func (log *FastXLogger) With(kvs ...xlogcore.KeyVal) xlogcore.FastXLog

With adds a variadic number of fields to the logging context.

func (*FastXLogger) WithOptions

func (log *FastXLogger) WithOptions(opts ...xlogcore.Option) xlogcore.FastXLog

WithOptions clones the current Logger, applies the supplied Options, and returns the resulting Logger. It's safe to use concurrently.

func (*FastXLogger) XLog

func (log *FastXLogger) XLog() xlogcore.XLog

XLog converting FastXLog to XLog. The operation is quite inexpensive.

type XLogger

type XLogger struct {
	// contains filtered or unexported fields
}

XLogger wraps zap SugaredLogger.

func NewXLogger

func NewXLogger(config xlogcore.Config) (*XLogger, error)

NewXLogger returns XLogger.

func (*XLogger) AddCallerSkip

func (log *XLogger) AddCallerSkip(n int) xlogcore.XLog

AddCallerSkip increases the number of callers skipped by caller annotation.

func (*XLogger) Debug

func (log *XLogger) Debug(args ...interface{})

Debug construct and log a Debug message.

func (*XLogger) Debugf

func (log *XLogger) Debugf(tpl string, args ...interface{})

Debugf construct and log a Debug message.

func (*XLogger) Error

func (log *XLogger) Error(args ...interface{})

Error construct and log a Error message.

func (*XLogger) Errorf

func (log *XLogger) Errorf(tpl string, args ...interface{})

Errorf construct and log a Error message.

func (*XLogger) Fast

func (log *XLogger) Fast() xlogcore.FastXLog

Fast converting XLog to FastXLog. The operation is quite inexpensive.

func (*XLogger) Fatal

func (log *XLogger) Fatal(args ...interface{})

Fatal construct and log a Fatal message, then calls os.Exit(1).

func (*XLogger) Fatalf

func (log *XLogger) Fatalf(tpl string, args ...interface{})

Fatalf construct and log a Fatal message, then calls os.Exit(1).

func (*XLogger) FromCtx

func (log *XLogger) FromCtx(ctx context.Context) xlogcore.XLog

FromCtx gets the XLog from the ctx.

func (*XLogger) Info

func (log *XLogger) Info(args ...interface{})

Info construct and log a Info message.

func (*XLogger) Infof

func (log *XLogger) Infof(tpl string, args ...interface{})

Infof construct and log a Info message.

func (*XLogger) Panic

func (log *XLogger) Panic(args ...interface{})

Panic construct and log a Panic message, then panics.

func (*XLogger) Panicf

func (log *XLogger) Panicf(tpl string, args ...interface{})

Panicf construct and log a Panic message, then panics.

func (*XLogger) Sync

func (log *XLogger) Sync()

Sync flushes buffered logs. Users should call Sync before exiting.

func (*XLogger) ToCtx

func (log *XLogger) ToCtx(ctx context.Context, kvs ...interface{}) context.Context

ToCtx adds the XLog, with a variadic number of fields, to ctx and returns the resulting context.Context.

func (*XLogger) Warn

func (log *XLogger) Warn(args ...interface{})

Warn construct and log a Warn message.

func (*XLogger) Warnf

func (log *XLogger) Warnf(tpl string, args ...interface{})

Warnf construct and log a Warn message.

func (*XLogger) With

func (log *XLogger) With(kvs ...interface{}) xlogcore.XLog

With adds a variadic number of fields to the logging context.

func (*XLogger) WithOptions

func (log *XLogger) WithOptions(opts ...xlogcore.Option) xlogcore.XLog

WithOptions clones the current Logger, applies the supplied Options, and returns the resulting Logger. It's safe to use concurrently.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL