logger

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(funcs ...LoggerOptFunc) error

func RotateLogs

func RotateLogs()

Types

type GeneralLogger

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

func (*GeneralLogger) Init

func (l *GeneralLogger) Init(opt *loggerOpt) error

func (*GeneralLogger) Rotate

func (l *GeneralLogger) Rotate()

func (*GeneralLogger) Write

func (l *GeneralLogger) Write(p []byte) (int, error)

type HttpLogger

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

func (*HttpLogger) Accesslog

func (l *HttpLogger) Accesslog(host, uri, method, ua []byte, status int)

func (*HttpLogger) Init

func (l *HttpLogger) Init(opt *loggerOpt) error

func (*HttpLogger) Logger

func (l *HttpLogger) Logger() *log.Logger

func (*HttpLogger) Rotate

func (l *HttpLogger) Rotate()

func (*HttpLogger) Write

func (l *HttpLogger) Write(p []byte) (int, error)

type Logger

type Logger interface {
	Rotate()
	Init(*loggerOpt) error
	Write([]byte) (int, error)
}

func GetLogger

func GetLogger(name string) Logger

type LoggerOptFunc

type LoggerOptFunc func(*loggerOpt)

func DebugMode

func DebugMode(enable bool) LoggerOptFunc

func LogDir

func LogDir(path string) LoggerOptFunc

func StdoutHttpLog

func StdoutHttpLog(enable bool) LoggerOptFunc

func StdoutNatsLog

func StdoutNatsLog(enable bool) LoggerOptFunc

func VerboseMode

func VerboseMode(enable bool) LoggerOptFunc

type NatsLogger

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

func (*NatsLogger) Debugf

func (l *NatsLogger) Debugf(format string, v ...interface{})

func (*NatsLogger) Errorf

func (l *NatsLogger) Errorf(format string, v ...interface{})

func (*NatsLogger) Fatalf

func (l *NatsLogger) Fatalf(format string, v ...interface{})

func (*NatsLogger) Init

func (l *NatsLogger) Init(opt *loggerOpt) error

func (*NatsLogger) Noticef

func (l *NatsLogger) Noticef(format string, v ...interface{})

func (*NatsLogger) Rotate

func (l *NatsLogger) Rotate()

func (*NatsLogger) ServerLogger

func (l *NatsLogger) ServerLogger() server.Logger

func (*NatsLogger) Tracef

func (l *NatsLogger) Tracef(format string, v ...interface{})

func (*NatsLogger) Warnf

func (l *NatsLogger) Warnf(format string, v ...interface{})

func (*NatsLogger) Write

func (l *NatsLogger) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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