log

package
v0.0.39 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2024 License: MIT Imports: 13 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

DefaultLogger is default logger.

Functions

func Debug

func Debug(a ...interface{})

Debug logs a message at debug level.

func Debugf

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

Debugf logs a message at debug level.

func Debugw

func Debugw(msg string, keyvals ...interface{})

Debugw logs a message at debug level.

func Error

func Error(a ...interface{})

Error logs a message at error level.

func ErrorPanic

func ErrorPanic(err interface{})

ErrorPanic logs a message at error level.

func ErrorStack

func ErrorStack(err error)

ErrorStack logs a message at error level.

func Errorf

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

Errorf logs a message at error level.

func Errorw

func Errorw(msg string, keyvals ...interface{})

Errorw logs a message at error level.

func Fatal

func Fatal(a ...interface{})

Fatal logs a message at fatal level.

func Fatalf

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

Fatalf logs a message at fatal level.

func Fatalw

func Fatalw(msg string, keyvals ...interface{})

Fatalw logs a message at fatal level.

func GetCore

func GetCore() zapcore.Core

func Info

func Info(a ...interface{})

Info logs a message at info level.

func Infof

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

Infof logs a message at info level.

func Infow

func Infow(msg string, keyvals ...interface{})

Infow logs a message at info level.

func Init

func Init(c []*core.Conf) core.Logger

func SetLogger

func SetLogger(logger *ZapLogger)

SetLogger should be called before any other log call. And it is NOT THREAD SAFE.

func Warn

func Warn(a ...interface{})

Warn logs a message at warn level.

func Warnf

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

Warnf logs a message at warnf level.

func Warnw

func Warnw(msg string, keyvals ...interface{})

Warnw logs a message at warnf level.

func WithCore added in v0.0.29

func WithCore(c zapcore.Core, kv ...interface{}) zapcore.Core

Types

type ZapLogger

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

func GetLogger

func GetLogger() *ZapLogger

GetLogger returns global logger appliance as logger in current process.

func NewLogger

func NewLogger(core zapcore.Core, n int) *ZapLogger

func NewZapLogger

func NewZapLogger(core zapcore.Core, n int) *ZapLogger

func With

func With(kv ...interface{}) *ZapLogger

func (*ZapLogger) Debug

func (s *ZapLogger) Debug(a ...interface{})

Debug logs a message at debug level.

func (*ZapLogger) Debugf

func (s *ZapLogger) Debugf(format string, a ...interface{})

Debugf logs a message at debug level.

func (*ZapLogger) Debugw

func (s *ZapLogger) Debugw(msg string, keyvals ...interface{})

Debugw logs a message at debug level.

func (*ZapLogger) Error

func (s *ZapLogger) Error(a ...interface{})

Error logs a message at error level.

func (*ZapLogger) Errorf

func (s *ZapLogger) Errorf(format string, a ...interface{})

Errorf logs a message at error level.

func (*ZapLogger) Errorw

func (s *ZapLogger) Errorw(msg string, keyvals ...interface{})

Errorw logs a message at error level.

func (*ZapLogger) Fatal

func (s *ZapLogger) Fatal(a ...interface{})

Fatal logs a message at fatal level.

func (*ZapLogger) Fatalf

func (s *ZapLogger) Fatalf(format string, a ...interface{})

Fatalf logs a message at fatal level.

func (*ZapLogger) Fatalw

func (s *ZapLogger) Fatalw(msg string, keyvals ...interface{})

Fatalw logs a message at fatal level.

func (*ZapLogger) Info

func (s *ZapLogger) Info(a ...interface{})

Info logs a message at info level.

func (*ZapLogger) Infof

func (s *ZapLogger) Infof(format string, a ...interface{})

Infof logs a message at info level.

func (*ZapLogger) Infow

func (s *ZapLogger) Infow(msg string, keyvals ...interface{})

Infow logs a message at info level.

func (*ZapLogger) Log

func (s *ZapLogger) Log(level log.Level, keyvals ...interface{}) error

Log print the kv pairs log.

func (*ZapLogger) LogRoundTrip

func (s *ZapLogger) LogRoundTrip(
	req *http.Request,
	res *http.Response,
	err error,
	start time.Time,
	dur time.Duration,
) error

LogRoundTrip prints the information about request and response.

func (*ZapLogger) Printf

func (s *ZapLogger) Printf(format string, args ...interface{})

func (*ZapLogger) Println

func (s *ZapLogger) Println(a ...interface{})

func (*ZapLogger) RequestBodyEnabled

func (s *ZapLogger) RequestBodyEnabled() bool

RequestBodyEnabled makes the client pass request body to logger

func (*ZapLogger) ResponseBodyEnabled

func (s *ZapLogger) ResponseBodyEnabled() bool

ResponseBodyEnabled makes the client pass response body to logger

func (*ZapLogger) Warn

func (s *ZapLogger) Warn(a ...interface{})

Warn logs a message at warn level.

func (*ZapLogger) Warnf

func (s *ZapLogger) Warnf(format string, a ...interface{})

Warnf logs a message at warnf level.

func (*ZapLogger) Warnw

func (s *ZapLogger) Warnw(msg string, keyvals ...interface{})

Warnw logs a message at warnf level.

func (*ZapLogger) With added in v0.0.29

func (s *ZapLogger) With(kv ...interface{}) *ZapLogger

type ZapLoggerEx

type ZapLoggerEx struct {
	ZapLogger
}

func NewZapLoggerEx

func NewZapLoggerEx(core zapcore.Core) *ZapLoggerEx

func (*ZapLoggerEx) Error

func (s *ZapLoggerEx) Error(err error, msg string, keysAndValues ...interface{})

Error logs an error condition.

func (*ZapLoggerEx) Info

func (s *ZapLoggerEx) Info(msg string, keysAndValues ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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