loki

package
v0.0.0-...-617738d Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(args ...any)

func Debugf

func Debugf(format string, args ...any)

func Error

func Error(args ...any)

func Errorf

func Errorf(format string, args ...any)

func Fatal

func Fatal(args ...any)

func Fatalf

func Fatalf(format string, args ...any)

func Info

func Info(args ...any)

func Infof

func Infof(format string, args ...any)

func NewBuffer

func NewBuffer() *bytes.Buffer

func PutBuffer

func PutBuffer(buf *bytes.Buffer)

func ReleaseEntry

func ReleaseEntry(entry *Entry)

func SetCallerSplitter

func SetCallerSplitter(splitter func(s string) string)

func SetFormatter

func SetFormatter(f Formatter)

func SetJob

func SetJob(job string)

func SetReportCaller

func SetReportCaller(report bool)

func SetUrl

func SetUrl(url string)

func Trace

func Trace(args ...any)

func Tracef

func Tracef(format string, args ...any)

func Wait

func Wait()

func Warn

func Warn(args ...any)

func Warnf

func Warnf(format string, args ...any)

Types

type DefaultFormatter

type DefaultFormatter struct {
}

func (*DefaultFormatter) Format

func (*DefaultFormatter) Format(level Level, msg string, logger *Logger) []byte

type Entry

type Entry struct {
	Streams []EntryStream `json:"streams"`
}

func NewEntry

func NewEntry() *Entry

func (*Entry) Bytes

func (e *Entry) Bytes() []byte

func (*Entry) String

func (e *Entry) String() string

type EntryJob

type EntryJob struct {
	Job string `json:"job"`
}

type EntryStream

type EntryStream struct {
	// Stream map[string]string `json:"stream"`
	Stream EntryJob   `json:"stream"`
	Values [][]string `json:"values"`
}

type Formatter

type Formatter interface {
	Format(level Level, msg string, logger *Logger) []byte
}

type Level

type Level uint32
const (
	PanicLevel Level = iota
	FatalLevel
	ErrorLevel
	WarnLevel
	InfoLevel
	DebugLevel
	TraceLevel
)

func ParseLevel

func ParseLevel(lvl string) (Level, error)

ParseLevel takes a string level and returns the Logrus log level constant.

func (Level) MarshalText

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

func (Level) String

func (level Level) String() string

func (*Level) UnmarshalText

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

UnmarshalText implements encoding.TextUnmarshaler.

type Logger

type Logger struct {
	Caller         *runtime.Frame
	CallerSplitter func(string) string
	Formatter      Formatter
	WaitGroup      *sync.WaitGroup
	// contains filtered or unexported fields
}

func New

func New() *Logger

func StandardLogger

func StandardLogger() *Logger

func (*Logger) Debug

func (logger *Logger) Debug(args ...any)

func (*Logger) Debugf

func (logger *Logger) Debugf(format string, args ...any)

func (*Logger) Error

func (logger *Logger) Error(args ...any)

func (*Logger) Errorf

func (logger *Logger) Errorf(format string, args ...any)

func (*Logger) Fatal

func (logger *Logger) Fatal(args ...any)

func (*Logger) Fatalf

func (logger *Logger) Fatalf(format string, args ...any)

func (*Logger) Info

func (logger *Logger) Info(args ...any)

func (*Logger) Infof

func (logger *Logger) Infof(format string, args ...any)

func (*Logger) Log

func (logger *Logger) Log(job string, level Level, args ...any)

func (*Logger) Logf

func (logger *Logger) Logf(job string, level Level, format string, args ...any)

func (*Logger) Trace

func (logger *Logger) Trace(args ...any)

func (*Logger) Tracef

func (logger *Logger) Tracef(format string, args ...any)

func (*Logger) Warn

func (logger *Logger) Warn(args ...any)

func (*Logger) Warnf

func (logger *Logger) Warnf(format string, args ...any)

Jump to

Keyboard shortcuts

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