flog

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package flog contains logging-related APIs.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Level

type Level int

Level denotes a log level. Check the constants below for more information.

const (
	Debug Level = iota
	Panic
)

func (Level) String

func (i Level) String() string

type Logger

type Logger interface {
	Debugf(format string, args ...interface{})
	Debugln(args ...interface{})
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Infoln(args ...interface{})
	Warnln(args ...interface{})
	Warnf(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Fatal(args ...interface{})
	SetLevel(level Level)
}

Logger should be used to write any logs. No concrete implementations should be directly used.

type Logrus

type Logrus struct{}

Logrus implements the Logger interface.

func NewLogrus

func NewLogrus() *Logrus

NewLogrus returns a new logrus logger.

func (*Logrus) Debugf

func (l *Logrus) Debugf(format string, args ...interface{})

Debugf logs a message at level Debug.

func (*Logrus) Debugln

func (l *Logrus) Debugln(args ...interface{})

Debugln logs a message at level Debug.

func (*Logrus) Error

func (l *Logrus) Error(args ...interface{})

Error logs a message at level Error.

func (*Logrus) Errorf

func (l *Logrus) Errorf(format string, args ...interface{})

Errorf logs a message at level Error.

func (*Logrus) Fatal

func (l *Logrus) Fatal(args ...interface{})

Fatal logs a message at level Fatal.

func (*Logrus) Info

func (l *Logrus) Info(args ...interface{})

Info logs a message at level Info.

func (*Logrus) Infof

func (l *Logrus) Infof(format string, args ...interface{})

Infof logs a message at level Info.

func (*Logrus) Infoln

func (l *Logrus) Infoln(args ...interface{})

Infoln logs a message at level Info.

func (*Logrus) SetLevel

func (l *Logrus) SetLevel(level Level)

SetLevel sets the level of the logger.

func (*Logrus) Warnf added in v0.5.0

func (l *Logrus) Warnf(format string, args ...interface{})

Warnf logs a message at level Warn.

func (*Logrus) Warnln

func (l *Logrus) Warnln(args ...interface{})

Warnln logs a message at level Warn.

Jump to

Keyboard shortcuts

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