log

package
v0.1.25 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: LGPL-2.1 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func DPanic

func DPanic(pluginProvider gxplugin.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(pluginProvider gxplugin.PluginProvider, format string, v ...interface{})

DPanicf logs a formatted message at DPanicLevel.

func DPanicln

func DPanicln(pluginProvider gxplugin.PluginProvider, v ...interface{})

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

func Debug

func Debug(pluginProvider gxplugin.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(pluginProvider gxplugin.PluginProvider, format string, v ...interface{})

Debugf logs a formatted message at DebugLevel.

func Debugln

func Debugln(pluginProvider gxplugin.PluginProvider, v ...interface{})

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

func Error

func Error(pluginProvider gxplugin.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(pluginProvider gxplugin.PluginProvider, format string, v ...interface{})

Errorf logs a formatted message at ErrorLevel.

func Errorln

func Errorln(pluginProvider gxplugin.PluginProvider, v ...interface{})

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

func Fatal

func Fatal(pluginProvider gxplugin.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(pluginProvider gxplugin.PluginProvider, format string, v ...interface{})

Fatalf logs a formatted message at FatalLevel.

func Fatalln

func Fatalln(pluginProvider gxplugin.PluginProvider, v ...interface{})

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

func Info

func Info(pluginProvider gxplugin.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(pluginProvider gxplugin.PluginProvider, format string, v ...interface{})

Infof logs a formatted message at InfoLevel.

func Infoln

func Infoln(pluginProvider gxplugin.PluginProvider, v ...interface{})

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

func Panic

func Panic(pluginProvider gxplugin.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(pluginProvider gxplugin.PluginProvider, format string, v ...interface{})

Panicf logs a formatted message at PanicLevel.

func Panicln

func Panicln(pluginProvider gxplugin.PluginProvider, v ...interface{})

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

func Trace

func Trace(pluginProvider gxplugin.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(pluginProvider gxplugin.PluginProvider, format string, v ...interface{})

Tracef logs a formatted message at TraceLevel.

func Traceln

func Traceln(pluginProvider gxplugin.PluginProvider, v ...interface{})

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

func Warn

func Warn(pluginProvider gxplugin.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(pluginProvider gxplugin.PluginProvider, format string, v ...interface{})

Warnf logs a formatted message at WarnLevel.

func Warnln

func Warnln(pluginProvider gxplugin.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