log

package
v0.1.97 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: LGPL-2.1 Imports: 6 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Name  = self.Name
	Using = self.Using
)

Functions

func DPanic

func DPanic(provider plugin.PluginProvider, v ...interface{})

DPanic logs a message at DPanicLevel, spaces are added between operands when neither is a string and a newline is appended.

func DPanicf

func DPanicf(provider plugin.PluginProvider, format string, v ...interface{})

DPanicf logs a formatted message at DPanicLevel.

func DPanicln

func DPanicln(provider plugin.PluginProvider, v ...interface{})

DPanicln logs a message at DPanicLevel, spaces are always added between operands and a newline is appended.

func Debug

func Debug(provider plugin.PluginProvider, v ...interface{})

Debug logs a message at DebugLevel, spaces are added between operands when neither is a string and a newline is appended.

func Debugf

func Debugf(provider plugin.PluginProvider, format string, v ...interface{})

Debugf logs a formatted message at DebugLevel.

func Debugln

func Debugln(provider plugin.PluginProvider, v ...interface{})

Debugln logs a message at DebugLevel, spaces are always added between operands and a newline is appended.

func Error

func Error(provider plugin.PluginProvider, v ...interface{})

Error logs a message at ErrorLevel, spaces are added between operands when neither is a string and a newline is appended.

func Errorf

func Errorf(provider plugin.PluginProvider, format string, v ...interface{})

Errorf logs a formatted message at ErrorLevel.

func Errorln

func Errorln(provider plugin.PluginProvider, v ...interface{})

Errorln logs a message at ErrorLevel, spaces are always added between operands and a newline is appended.

func Fatal

func Fatal(provider plugin.PluginProvider, v ...interface{})

Fatal logs a message at FatalLevel, spaces are added between operands when neither is a string and a newline is appended.

func Fatalf

func Fatalf(provider plugin.PluginProvider, format string, v ...interface{})

Fatalf logs a formatted message at FatalLevel.

func Fatalln

func Fatalln(provider plugin.PluginProvider, v ...interface{})

Fatalln logs a message at FatalLevel, spaces are always added between operands and a newline is appended.

func Info

func Info(provider plugin.PluginProvider, v ...interface{})

Info logs a message at InfoLevel, spaces are added between operands when neither is a string and a newline is appended.

func Infof

func Infof(provider plugin.PluginProvider, format string, v ...interface{})

Infof logs a formatted message at InfoLevel.

func Infoln

func Infoln(provider plugin.PluginProvider, v ...interface{})

Infoln logs a message at InfoLevel, spaces are always added between operands and a newline is appended.

func Panic

func Panic(provider plugin.PluginProvider, v ...interface{})

Panic logs a message at PanicLevel, spaces are added between operands when neither is a string and a newline is appended.

func Panicf

func Panicf(provider plugin.PluginProvider, format string, v ...interface{})

Panicf logs a formatted message at PanicLevel.

func Panicln

func Panicln(provider plugin.PluginProvider, v ...interface{})

Panicln logs a message at PanicLevel, spaces are always added between operands and a newline is appended.

func Trace

func Trace(provider plugin.PluginProvider, v ...interface{})

Trace logs a message at TraceLevel, spaces are added between operands when neither is a string and a newline is appended.

func Tracef

func Tracef(provider plugin.PluginProvider, format string, v ...interface{})

Tracef logs a formatted message at TraceLevel.

func Traceln

func Traceln(provider plugin.PluginProvider, v ...interface{})

Traceln logs a message at TraceLevel, spaces are always added between operands and a newline is appended.

func Warn

func Warn(provider plugin.PluginProvider, v ...interface{})

Warn logs a message at WarnLevel, spaces are added between operands when neither is a string and a newline is appended.

func Warnf

func Warnf(provider plugin.PluginProvider, format string, v ...interface{})

Warnf logs a formatted message at WarnLevel.

func Warnln

func Warnln(provider plugin.PluginProvider, v ...interface{})

Warnln logs a message at WarnLevel, spaces are always added between operands and a newline is appended.

Types

type ILogger

type ILogger interface {
	// Log writes a log entry, spaces are added between operands when neither is a string and a newline is appended.
	Log(level Level, v ...interface{})
	// Logln writes a log entry, spaces are always added between operands and a newline is appended.
	Logln(level Level, v ...interface{})
	// Logf writes a formatted log entry.
	Logf(level Level, format string, v ...interface{})
}

ILogger is a generic logging interface

type Level

type Level int8

A Level is a logging priority. Higher levels are more important.

const (
	// TraceLevel level. Designates finer-grained informational events than the Debug.
	TraceLevel Level = iota
	// DebugLevel level. Usually only enabled when debugging. Very verbose logging.
	DebugLevel
	// InfoLevel is the default logging priority.
	// General operational entries about what's going on inside the application.
	InfoLevel
	// WarnLevel level. Non-critical entries that deserve eyes.
	WarnLevel
	// ErrorLevel level. Logs. Used for errors that should definitely be noted.
	ErrorLevel
	// DPanicLevel level. Logs and call `panic()` in development mode.
	DPanicLevel
	// PanicLevel level. Logs and call `panic()`.
	PanicLevel
	// FatalLevel level. Logs and then calls `logger.Exit(1)`. highest level of severity.
	FatalLevel
)

func (Level) CapitalString

func (l Level) CapitalString() string

CapitalString returns an all-caps ASCII representation of the log level.

func (Level) Enabled

func (l Level) Enabled(level Level) bool

Enabled returns true if the given level is at or above this level.

func (Level) Get

func (l Level) Get() interface{}

Get gets the level for the flag.Getter interface.

func (Level) MarshalText

func (l Level) MarshalText() ([]byte, error)

MarshalText marshals the Level to text. Note that the text representation drops the -Level suffix (see example).

func (*Level) Set

func (l *Level) Set(str string) error

Set converts a level string into a logger Level value. returns error if the input string does not match known values.

func (Level) String

func (l Level) String() string

String returns a lower-case ASCII representation of the log level.

func (*Level) UnmarshalText

func (l *Level) UnmarshalText(text []byte) error

UnmarshalText unmarshals text to a level. Like MarshalText, UnmarshalText expects the text representation of a Level to drop the -Level suffix (see example).

In particular, this makes it easy to configure logging levels using YAML, TOML, or JSON files.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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