log

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	KV       = zap.Any
	KVString = zap.String
	KVInt    = zap.Int
	KVTime   = zap.Time
	KVBool   = zap.Bool
	KVFloat  = zap.Float64
)

Functions

func Close

func Close() error

func Error

func Error(format string, args ...interface{})

Error logs a message at the error log level.

func Errorv

func Errorv(ctx context.Context, fields ...Field)

Errorv logs a message at the error log level.

func Errorw

func Errorw(args ...interface{})

Errorw logs a message with some additional context. The variadic key-value pairs are treated as they are in With.

func Info

func Info(format string, args ...interface{})

Info logs a message at the info log level.

func Infov

func Infov(ctx context.Context, fields ...Field)

Infov logs a message at the info log level.

func Infow

func Infow(args ...interface{})

Infow logs a message with some additional context. The variadic key-value pairs are treated as they are in With.

func Init

func Init(conf *Config)

Init create logger with context.

func SugarSync

func SugarSync()

func Sync

func Sync()

func Warn

func Warn(format string, args ...interface{})

Warn logs a message at the warning log level.

func Warnv

func Warnv(ctx context.Context, fields ...Field)

Warnv logs a message at the warning log level.

func Warnw

func Warnw(args ...interface{})

Warnw logs a message with some additional context. The variadic key-value pairs are treated as they are in With.

Types

type Config

type Config struct {
	// stdout
	Stdout bool

	// level
	Level zapcore.Level

	// file
	Dir string
	// MaxLogFileSize
	MaxLogFileSize int
	// MaxLogAge
	MaxLogAge int
	// MaxLogBackups
	MaxLogBackups int
	// LogCompress
	LogCompress bool
}

Config log config.

type Field

type Field = zap.Field

type Logger

type Logger = *zap.Logger

type SugaredLogger

type SugaredLogger = *zap.SugaredLogger

Jump to

Keyboard shortcuts

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