log

package
v3.0.0-...-93162ec Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const MaxLogSqlLength = 1024

Variables

View Source
var ServerID = randomID()

Functions

func Close

func Close(ctx context.Context)

func ConfigLog

func ConfigLog()

func GetLogDuration

func GetLogDuration(isDebug bool, s time.Time) time.Duration

func GetLogLevel

func GetLogLevel() logrus.Level

func GetLogNow

func GetLogNow(isDebug bool) time.Time

func GetLogSql

func GetLogSql(sql string) string

func GetLogger

func GetLogger(model string) *logrus.Entry

func GinLog

func GinLog() gin.HandlerFunc

func GinRecoverLog

func GinRecoverLog() gin.HandlerFunc

func IsDebug

func IsDebug() bool

func SetLevel

func SetLevel(level string) error

Types

type FileHook

type FileHook struct {
	sync.Mutex
	// contains filtered or unexported fields
}

func NewFileHook

func NewFileHook(formatter logrus.Formatter, writer io.WriteCloser) *FileHook

func (*FileHook) Fire

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

func (*FileHook) Levels

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

type TaosLogFormatter

type TaosLogFormatter struct {
}

func (*TaosLogFormatter) Format

func (t *TaosLogFormatter) Format(entry *logrus.Entry) ([]byte, error)

type TaosSqlLogFormatter

type TaosSqlLogFormatter struct {
}

func (*TaosSqlLogFormatter) Format

func (t *TaosSqlLogFormatter) Format(entry *logrus.Entry) ([]byte, error)

Jump to

Keyboard shortcuts

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