logapi

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2024 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fields

type Fields map[string]interface{}

Fields type, used to pass to `WithFields`.

type Interface

type Interface interface {
	Logf(level Level, format string, args ...interface{})
	Log(level Level, args ...interface{})
	Level() Level
	SetLevel(Level)
	SetLoggerOutputFileConfig(conf LoggerOutputFileConf)
	SetLoggerOutputType(outputType LoggerOutputType)
}

Interface extend Logger support. add level with Logger

type Level

type Level uint32

Level logger level

const (
	// PanicLevel level, highest level of severity. Logs and then calls panic with the
	// message passed to Debug, Info, ...
	PanicLevel Level = iota
	// FatalLevel level. Logs and then calls `logger.Exit(1)`. It will exit even if the
	// logging level is set to Panic.
	FatalLevel
	// ErrorLevel level. Logs. Used for errors that should definitely be noted.
	// Commonly used for hooks to send errors to an error tracking service.
	ErrorLevel
	// WarnLevel level. Non-critical entries that deserve eyes.
	WarnLevel
	// InfoLevel level. General operational entries about what's going on inside the
	// application.
	InfoLevel
	// DebugLevel level. Usually only enabled when debugging. Very verbose logging.
	DebugLevel
	// TraceLevel level. Designates finer-grained informational events than the Debug.
	TraceLevel
)

func String2Level

func String2Level(level string) Level

String2Level convert string level into level

type LoggerOutputFileConf

type LoggerOutputFileConf struct {
	LocalFile      string
	RotateInterval int
	MaxFileSize    float64
}

type LoggerOutputType

type LoggerOutputType string
const (
	LoggerOutputTypeStdOut LoggerOutputType = "stdout"
	LoggerOutputTypeFile   LoggerOutputType = "file"
)

Directories

Path Synopsis
Package logrus provides an adapter to the go-kit log.Logger interface.
Package logrus provides an adapter to the go-kit log.Logger interface.

Jump to

Keyboard shortcuts

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