logger

package
v0.0.0-...-e39a43b Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: MIT Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BufLogger

func BufLogger(buf *bytes.Buffer) *zap.Logger

For unit test

func Close

func Close()

func Debugf

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

func Errorf

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

func Fatalf

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

func Infof

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

func Named

func Named(name string) *zap.Logger

func Panicf

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

func Setup

func Setup(opt Config) error

func Warnf

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

Types

type Config

type Config struct {
	Path  string `yaml:"path"`
	Level string `yaml:"level"`
}

type WriteSyncer

type WriteSyncer struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*WriteSyncer) Close

func (w *WriteSyncer) Close() error

func (*WriteSyncer) Sync

func (w *WriteSyncer) Sync() error

exec when the log Level > ErrorLevel

func (*WriteSyncer) Write

func (w *WriteSyncer) Write(p []byte) (n int, err error)

write into the buffer, auto flush when buf is full.

Jump to

Keyboard shortcuts

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