logger

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const TimestampFormat = "2006-01-02 15:04:05"

Variables

This section is empty.

Functions

func FileAndTerminalStdout

func FileAndTerminalStdout(path, fileName string) io.Writer

func FileStdout

func FileStdout(path, fileName string) io.Writer

func GetJsonFormatter

func GetJsonFormatter() logrus.Formatter

func GetTextFormatter

func GetTextFormatter() logrus.Formatter

Types

type Caller

type Caller struct {
	EndString string
}

func (*Caller) Fire

func (c *Caller) Fire(entry *logrus.Entry) error

func (*Caller) Levels

func (c *Caller) Levels() []logrus.Level

type Config

type Config struct {
	Path      string
	Name      string
	Level     string
	Formatter logrus.Formatter
}

type Logger

type Logger struct {
	*logrus.Logger
	io.Writer
	Config
}

func New

func New(writer io.Writer, config Config) *Logger

func (*Logger) AddHook

func (l *Logger) AddHook(hook logrus.Hook)

func (*Logger) Debug

func (l *Logger) Debug(msg string)

func (*Logger) Debugf

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

func (*Logger) Error

func (l *Logger) Error(msg string)

func (*Logger) Errorf

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

func (*Logger) Fatal

func (l *Logger) Fatal(msg string)

func (*Logger) Fatalf

func (l *Logger) Fatalf(format string, args ...interface{})

func (*Logger) Info

func (l *Logger) Info(msg string)

func (*Logger) Infof

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

func (*Logger) Panic

func (l *Logger) Panic(msg string)

func (*Logger) Panicf

func (l *Logger) Panicf(format string, args ...interface{})

func (*Logger) Warn

func (l *Logger) Warn(msg string)

func (*Logger) Warnf

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

func (*Logger) WithFields

func (l *Logger) WithFields(fields map[string]interface{}) *Logger

Jump to

Keyboard shortcuts

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