logger

package
v1.0.15 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CoreLogFileName       = "core.log"
	GrpcLogFileName       = "grpc.log"
	GinLogFileName        = "gin.log"
	GCLogFileName         = "gc.log"
	StorageGCLogFileName  = "storage-gc.log"
	JobLogFileName        = "job.log"
	StatSeedLogFileName   = "stat/seed.log"
	DownloaderLogFileName = "downloader.log"
	KeepAliveLogFileName  = "keepalive.log"
)
View Source
var (
	CoreLogger       *zap.SugaredLogger
	GrpcLogger       *zap.SugaredLogger
	GinLogger        *zap.SugaredLogger
	GCLogger         *zap.SugaredLogger
	StorageGCLogger  *zap.SugaredLogger
	JobLogger        *zap.SugaredLogger
	KeepAliveLogger  *zap.SugaredLogger
	StatSeedLogger   *zap.Logger
	DownloaderLogger *zap.Logger
)

Functions

func CreateLogger

func CreateLogger(filePath string, compress bool, stats bool, verbose bool) (*zap.Logger, zap.AtomicLevel, error)

func Debug

func Debug(args ...any)

func Debugf

func Debugf(template string, args ...any)

func Error

func Error(args ...any)

func Errorf

func Errorf(template string, args ...any)

func Fatal

func Fatal(args ...any)

func Fatalf

func Fatalf(template string, args ...any)

func Info

func Info(args ...any)

func Infof

func Infof(template string, args ...any)

func InitDaemon

func InitDaemon(verbose, console bool, dir string) error

func InitDfcache

func InitDfcache(console bool, dir string) error

func InitDfget

func InitDfget(verbose, console bool, dir string) error

func InitManager

func InitManager(verbose, console bool, dir string) error

func InitScheduler

func InitScheduler(verbose, console bool, dir string) error

func InitTrainer

func InitTrainer(verbose, console bool, dir string) error

func IsDebug

func IsDebug() bool

func RedirectStdoutAndStderr

func RedirectStdoutAndStderr(console bool, logDir string)

Redirect stdout and stderr to file for debugging.

func SetCoreLevel

func SetCoreLevel(level zapcore.Level)

func SetCoreLogger

func SetCoreLogger(log *zap.SugaredLogger)

func SetDownloadLogger

func SetDownloadLogger(log *zap.Logger)

func SetGCLogger

func SetGCLogger(log *zap.SugaredLogger)

func SetGinLogger

func SetGinLogger(log *zap.SugaredLogger)

func SetGrpcLevel

func SetGrpcLevel(level zapcore.Level)

func SetGrpcLogger

func SetGrpcLogger(log *zap.SugaredLogger)

func SetJobLogger

func SetJobLogger(log *zap.SugaredLogger)

func SetKeepAliveLogger

func SetKeepAliveLogger(log *zap.SugaredLogger)

func SetLevel

func SetLevel(level zapcore.Level)

SetLevel updates all log level

func SetStatSeedLogger

func SetStatSeedLogger(log *zap.Logger)

func SetStorageGCLogger

func SetStorageGCLogger(log *zap.SugaredLogger)

func Warn

func Warn(args ...any)

func Warnf

func Warnf(template string, args ...any)

Types

type SugaredLoggerOnWith

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

func With

func With(args ...any) *SugaredLoggerOnWith

func WithGroupAndJobID

func WithGroupAndJobID(taskID, jobID string) *SugaredLoggerOnWith

func WithGroupAndTaskID

func WithGroupAndTaskID(groupID, taskID string) *SugaredLoggerOnWith

func WithHost

func WithHost(hostID, hostname, ip string) *SugaredLoggerOnWith

func WithHostID

func WithHostID(hostID string) *SugaredLoggerOnWith

func WithHostnameAndIP

func WithHostnameAndIP(hostname, ip string) *SugaredLoggerOnWith

func WithKeepAlive

func WithKeepAlive(hostname, ip, sourceType string, clusterID uint64) *SugaredLoggerOnWith

func WithPeer

func WithPeer(hostID, taskID, peerID string) *SugaredLoggerOnWith

func WithTask

func WithTask(taskID, url string) *SugaredLoggerOnWith

func WithTaskAndPeerID

func WithTaskAndPeerID(taskID, peerID string) *SugaredLoggerOnWith

func WithTaskID

func WithTaskID(taskID string) *SugaredLoggerOnWith

func (*SugaredLoggerOnWith) Debug

func (log *SugaredLoggerOnWith) Debug(args ...any)

func (*SugaredLoggerOnWith) Debugf

func (log *SugaredLoggerOnWith) Debugf(template string, args ...any)

func (*SugaredLoggerOnWith) Error

func (log *SugaredLoggerOnWith) Error(args ...any)

func (*SugaredLoggerOnWith) Errorf

func (log *SugaredLoggerOnWith) Errorf(template string, args ...any)

func (*SugaredLoggerOnWith) Info

func (log *SugaredLoggerOnWith) Info(args ...any)

func (*SugaredLoggerOnWith) Infof

func (log *SugaredLoggerOnWith) Infof(template string, args ...any)

func (*SugaredLoggerOnWith) IsDebug

func (log *SugaredLoggerOnWith) IsDebug() bool

func (*SugaredLoggerOnWith) Warn

func (log *SugaredLoggerOnWith) Warn(args ...any)

func (*SugaredLoggerOnWith) Warnf

func (log *SugaredLoggerOnWith) Warnf(template string, args ...any)

func (*SugaredLoggerOnWith) With

func (log *SugaredLoggerOnWith) With(args ...any) *SugaredLoggerOnWith

Jump to

Keyboard shortcuts

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