driver

package
v0.10.7 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisteDriver

func RegisteDriver(driver Driver)

registered with the same name, the one registered last will take effect.

Types

type Driver

type Driver interface {
	// Retrieve the name of current driver, like 'default', 'zap', 'logrus' ...
	Name() string

	// Print responsible of printing the standard Log
	Print(r *core.Record)

	// Retrieve log level of the specified logger,
	// it should return the lowest Level that could be print,
	// which can help invoker to decide whether prepare print or not.
	GetLevel(logger string) core.Level
}

Driver define the standard log print specification

func GetDriver

func GetDriver(name string) Driver

GetDriver gets a registered Driver by driver name, or nil if no Driver is registered for the driver name.

The driver name is expected to be lowercase.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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