logger

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2025 License: MIT Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultContext = proto.Context{"default", "0.0.0", HostName}
)
View Source
var HostName = getHost()

Functions

This section is empty.

Types

type Logger

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

logger for private

func New

func New(ctx *proto.Context, loggerName string, callerDepth int, level proto.Level, adapter ...proto.Adapter) *Logger

func NewDefaultLogger

func NewDefaultLogger(loggerName string, adapter ...proto.Adapter) *Logger

func (*Logger) Close

func (l *Logger) Close()

Close logger it is over time, suggest to call Exit because when logger closed, program also done.

func (*Logger) Debug

func (l *Logger) Debug(msg ...interface{})

func (*Logger) Debugf

func (l *Logger) Debugf(f string, msg ...interface{})

func (*Logger) Error

func (l *Logger) Error(msg ...interface{})

func (*Logger) Errorf

func (l *Logger) Errorf(f string, msg ...interface{})

func (*Logger) Exit

func (l *Logger) Exit(code int, msg ...interface{})

func (*Logger) ExitWithLevel

func (l *Logger) ExitWithLevel(code int, level proto.Level, msg ...interface{})

Exit log an info level message, and close log, then call os.Exit(code)

Param code -- code of os exit msg -- exit message

func (*Logger) Fatal

func (l *Logger) Fatal(msg ...interface{})

func (*Logger) Fatalf

func (l *Logger) Fatalf(f string, msg ...interface{})

func (*Logger) GetAdapter

func (l *Logger) GetAdapter() []proto.Adapter

func (*Logger) GetOutputLevel

func (l *Logger) GetOutputLevel() proto.Level

func (*Logger) Info

func (l *Logger) Info(msg ...interface{})

func (*Logger) Infof

func (l *Logger) Infof(f string, msg ...interface{})

func (*Logger) Panic

func (l *Logger) Panic(msg ...interface{})

func (*Logger) Panicf

func (l *Logger) Panicf(f string, msg ...interface{})

func (*Logger) Print

func (l *Logger) Print(msg ...interface{})

func (*Logger) Printf

func (l *Logger) Printf(f string, msg ...interface{})

func (*Logger) Put

func (l *Logger) Put(data []*proto.Data)

func (*Logger) SetAdapter

func (l *Logger) SetAdapter(adapters []proto.Adapter)

func (*Logger) SetCallerDepth added in v0.0.2

func (l *Logger) SetCallerDepth(depth int)

when depth<=0, close the caller path

func (*Logger) SetOutputLevel

func (l *Logger) SetOutputLevel(level proto.Level)

func (*Logger) Warn

func (l *Logger) Warn(msg ...interface{})

func (*Logger) Warnf

func (l *Logger) Warnf(f string, msg ...interface{})

Directories

Path Synopsis
adapter

Jump to

Keyboard shortcuts

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