logger

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CleanFormatter added in v1.1.0

type CleanFormatter struct{}

CleanFormatter provides clean output with just the message

func (*CleanFormatter) Format added in v1.1.0

func (f *CleanFormatter) Format(entry *logrus.Entry) ([]byte, error)

type FileHook added in v1.1.0

type FileHook struct {
	// contains filtered or unexported fields
}

FileHook implements logrus.Hook interface for file logging with different format

func (*FileHook) Fire added in v1.1.0

func (hook *FileHook) Fire(entry *logrus.Entry) error

func (*FileHook) Levels added in v1.1.0

func (hook *FileHook) Levels() []logrus.Level

type Logger

type Logger struct {
	*logrus.Logger
}

func NewFileLogger

func NewFileLogger(level, logFile string) (*Logger, error)

func NewFileLoggerWithFormat added in v1.1.0

func NewFileLoggerWithFormat(level, logFile, format string) (*Logger, error)

func NewFileLoggerWithSeparateFormats added in v1.1.0

func NewFileLoggerWithSeparateFormats(level, logFile, stdoutFormat, fileFormat string) (*Logger, error)

func NewLogger

func NewLogger(level string) *Logger

func NewLoggerWithFormat added in v1.1.0

func NewLoggerWithFormat(level, format string) *Logger

func (*Logger) WithBackupFile

func (l *Logger) WithBackupFile(fileName string) *logrus.Entry

func (*Logger) WithDatabase

func (l *Logger) WithDatabase(dbName string) *logrus.Entry

func (*Logger) WithError

func (l *Logger) WithError(err error) *logrus.Entry

Jump to

Keyboard shortcuts

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