log

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BootErrorf

func BootErrorf(c core.Context, format string, args ...any)

BootErrorf logs boot error log

func BootInfof

func BootInfof(c core.Context, format string, args ...any)

BootInfof logs boot info log

func BootWarnf

func BootWarnf(c core.Context, format string, args ...any)

BootWarnf logs boot warn log

func CliErrorf added in v0.6.0

func CliErrorf(c core.Context, format string, args ...any)

CliErrorf logs boot error log

func CliInfof added in v0.6.0

func CliInfof(c core.Context, format string, args ...any)

CliInfof logs boot info log

func CliWarnf added in v0.6.0

func CliWarnf(c core.Context, format string, args ...any)

CliWarnf logs boot warn log

func Debugf

func Debugf(c core.Context, format string, args ...any)

DebugfWithRequestId logs debug log with custom format

func Errorf

func Errorf(c core.Context, format string, args ...any)

Errorf logs error log with custom format

func ErrorfWithExtra added in v0.6.0

func ErrorfWithExtra(c core.Context, extraString string, format string, args ...any)

ErrorfWithExtra logs error log with custom format and extra info

func Infof

func Infof(c core.Context, format string, args ...any)

Infof logs info log with custom format

func Requestf

func Requestf(c core.Context, format string, args ...any)

Requestf logs http request log with custom format

func SetLoggerConfiguration

func SetLoggerConfiguration(config *settings.Config, isDisableBootLog bool) error

SetLoggerConfiguration sets the logger according to the config

func SqlQuery

func SqlQuery(args ...any)

SqlQuery logs sql query log

func SqlQueryf

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

SqlQueryf logs sql query log with custom format

func Warnf

func Warnf(c core.Context, format string, args ...any)

Warnf logs warn log with custom format

Types

type LogFormatter

type LogFormatter struct {
	Prefix       string
	DisableLevel bool
}

LogFormatter represents a log formatter

func (*LogFormatter) Format

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

Format writes to log according to the log entry

type RotateFileWriter added in v0.5.0

type RotateFileWriter struct {
	EnableRotate bool
	MaxFileSize  int64
	MaxFileDays  uint32
	// contains filtered or unexported fields
}

func NewRotateFileWriter added in v0.5.0

func NewRotateFileWriter(filePath string, enableRotate bool, maxFileSize int64, maxFileDays uint32) (*RotateFileWriter, error)

NewRotateFileWriter returns a new rotate file writer

func (*RotateFileWriter) Write added in v0.5.0

func (w *RotateFileWriter) Write(p []byte) (n int, err error)

Write does log data to specified file

Jump to

Keyboard shortcuts

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