log

package
v0.2.82 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: LGPL-2.1 Imports: 5 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

func DPanic

func DPanic(provider extension.AddInProvider, 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 extension.AddInProvider, format string, v ...interface{})

DPanicf logs a formatted message at DPanicLevel.

func DPanicln

func DPanicln(provider extension.AddInProvider, v ...interface{})

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

func Debug

func Debug(provider extension.AddInProvider, 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 extension.AddInProvider, format string, v ...interface{})

Debugf logs a formatted message at DebugLevel.

func Debugln

func Debugln(provider extension.AddInProvider, v ...interface{})

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

func Error

func Error(provider extension.AddInProvider, 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 extension.AddInProvider, format string, v ...interface{})

Errorf logs a formatted message at ErrorLevel.

func Errorln

func Errorln(provider extension.AddInProvider, v ...interface{})

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

func Fatal

func Fatal(provider extension.AddInProvider, 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 extension.AddInProvider, format string, v ...interface{})

Fatalf logs a formatted message at FatalLevel.

func Fatalln

func Fatalln(provider extension.AddInProvider, v ...interface{})

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

func Info

func Info(provider extension.AddInProvider, 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 extension.AddInProvider, format string, v ...interface{})

Infof logs a formatted message at InfoLevel.

func Infoln

func Infoln(provider extension.AddInProvider, v ...interface{})

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

func Panic

func Panic(provider extension.AddInProvider, 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 extension.AddInProvider, format string, v ...interface{})

Panicf logs a formatted message at PanicLevel.

func Panicln

func Panicln(provider extension.AddInProvider, v ...interface{})

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

func Trace

func Trace(provider extension.AddInProvider, 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 extension.AddInProvider, format string, v ...interface{})

Tracef logs a formatted message at TraceLevel.

func Traceln

func Traceln(provider extension.AddInProvider, v ...interface{})

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

func Warn

func Warn(provider extension.AddInProvider, 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 extension.AddInProvider, format string, v ...interface{})

Warnf logs a formatted message at WarnLevel.

func Warnln

func Warnln(provider extension.AddInProvider, 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