log

package
v0.0.0-...-3b4426b Latest Latest
Warning

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

Go to latest
Published: May 22, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DPanicf

func DPanicf(template string, args ...interface{})

DPanicf uses fmt.Sprintf to log a templated message. In development, the log then panics. (See DPanicLevel for details.)

func Debugf

func Debugf(template string, args ...interface{})

func Errorf

func Errorf(template string, args ...interface{})

Errorf uses fmt.Sprintf to log a templated message.

func Fatalf

func Fatalf(template string, args ...interface{})

Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.

func Infof

func Infof(template string, args ...interface{})

func Panicf

func Panicf(template string, args ...interface{})

Panicf uses fmt.Sprintf to log a templated message, then panics.

func SetLogger

func SetLogger(l Logger)

SetLogger set the log

func Warnf

func Warnf(template string, args ...interface{})

Warnf uses fmt.Sprintf to log a templated message.

Types

type DefaultLogger

type DefaultLogger struct {
	*zap.SugaredLogger
}

DefaultLogger write log by zap log

func (*DefaultLogger) DPanicf

func (s *DefaultLogger) DPanicf(template string, args ...interface{})

func (*DefaultLogger) Debugf

func (s *DefaultLogger) Debugf(template string, args ...interface{})

func (*DefaultLogger) Errorf

func (s *DefaultLogger) Errorf(template string, args ...interface{})

func (*DefaultLogger) Fatalf

func (s *DefaultLogger) Fatalf(template string, args ...interface{})

func (*DefaultLogger) Infof

func (s *DefaultLogger) Infof(template string, args ...interface{})

func (*DefaultLogger) Panicf

func (s *DefaultLogger) Panicf(template string, args ...interface{})

func (*DefaultLogger) Warnf

func (s *DefaultLogger) Warnf(template string, args ...interface{})

type Logger

type Logger interface {
	// Debugf uses fmt.Sprintf to log a templated message.
	// DebugLevel logs are typically voluminous, and are usually disabled in
	// production.
	Debugf(template string, args ...interface{})

	// Infof uses fmt.Sprintf to log a templated message.
	// InfoLevel is the default logging priority.
	Infof(template string, args ...interface{})

	// Warnf uses fmt.Sprintf to log a templated message.
	// WarnLevel logs are more important than Info, but don't need individual
	// human review.
	Warnf(template string, args ...interface{})

	// Errorf uses fmt.Sprintf to log a templated message.
	// ErrorLevel logs are high-priority. If an application is running smoothly,
	// it shouldn't generate any error-level logs.
	Errorf(template string, args ...interface{})

	// DPanicf uses fmt.Sprintf to log a templated message. In development, the
	// DPanicLevel logs are particularly important errors. In development the
	// log panics after writing the message.
	DPanicf(template string, args ...interface{})

	// Panicf uses fmt.Sprintf to log a templated message, then panics.
	Panicf(template string, args ...interface{})

	// Fatalf uses fmt.Sprintf to log a templated message, then calls os.Exit.
	Fatalf(template string, args ...interface{})
}

Logger define the log api for eventmesh

Jump to

Keyboard shortcuts

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