logging

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2020 License: Apache-2.0 Imports: 3 Imported by: 90

Documentation

Index

Constants

View Source
const (
	DefaultNamespace = "default"
	// RecordLogFileName represents the default file name of the record log.
	RecordLogFileName = "sentinel-record.log"
	DefaultDirName    = "logs" + string(os.PathSeparator) + "csp" + string(os.PathSeparator)
)

Variables

This section is empty.

Functions

func ResetDefaultLogger

func ResetDefaultLogger(log *log.Logger, namespace string)

func SetGlobalLoggerLevel

func SetGlobalLoggerLevel(l Level)

Types

type Level

type Level uint8

Level represents the level of logging.

const (
	Debug Level = iota
	Info
	Warn
	Error
	Fatal
	Panic
)

func GetGlobalLoggerLevel

func GetGlobalLoggerLevel() Level

type Logger

type Logger interface {
	Debug(v ...interface{})
	Debugf(format string, v ...interface{})

	Info(v ...interface{})
	Infof(format string, v ...interface{})

	Warn(v ...interface{})
	Warnf(format string, v ...interface{})

	Error(v ...interface{})
	Errorf(format string, v ...interface{})

	Fatal(v ...interface{})
	Fatalf(format string, v ...interface{})

	Panic(v ...interface{})
	Panicf(format string, v ...interface{})
}

func GetDefaultLogger

func GetDefaultLogger() Logger

type SentinelLogger

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

sentinel general logger

func NewConsoleLogger

func NewConsoleLogger(namespace string) *SentinelLogger

func NewSimpleFileLogger

func NewSimpleFileLogger(filepath, namespace string, flag int) (*SentinelLogger, error)

outputFile is the full path(absolute path)

func (*SentinelLogger) Debug

func (l *SentinelLogger) Debug(v ...interface{})

func (*SentinelLogger) Debugf

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

func (*SentinelLogger) Error

func (l *SentinelLogger) Error(v ...interface{})

func (*SentinelLogger) Errorf

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

func (*SentinelLogger) Fatal

func (l *SentinelLogger) Fatal(v ...interface{})

func (*SentinelLogger) Fatalf

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

func (*SentinelLogger) Info

func (l *SentinelLogger) Info(v ...interface{})

func (*SentinelLogger) Infof

func (l *SentinelLogger) Infof(format string, v ...interface{})

func (*SentinelLogger) Panic

func (l *SentinelLogger) Panic(v ...interface{})

func (*SentinelLogger) Panicf

func (l *SentinelLogger) Panicf(format string, v ...interface{})

func (*SentinelLogger) Warn

func (l *SentinelLogger) Warn(v ...interface{})

func (*SentinelLogger) Warnf

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

Jump to

Keyboard shortcuts

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