logger

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DEBUG = iota
	INFO
	WARN
	ERROR
)

Variables

This section is empty.

Functions

func CloseLogger

func CloseLogger()

func Debug

func Debug(msg string, param ...any)

func Error

func Error(msg string, param ...any)

func Info

func Info(msg string, param ...any)

func InitLogger

func InitLogger(cfg *Config)

func ParseLevel

func ParseLevel(level string) int

func Raw added in v1.0.6

func Raw(data []byte)

func Stack

func Stack() string

func StackAll

func StackAll() string

func Warn

func Warn(msg string, param ...any)

Types

type Config

type Config struct {
	AppName      string
	Level        int
	TrackLine    bool
	TrackThread  bool
	EnableFile   bool
	FilePath     string
	FileSizeCut  bool
	FileMaxSize  int32
	FileTimeCut  bool
	DisableColor bool
	EnableJson   bool
}

func GetConfig

func GetConfig() *Config

type LogFlag

type LogFlag struct {
	LogTag    string
	LogJson   string
	LogLine   string
	LogThread string
}

type LogInfo

type LogInfo struct {
	Time        time.Time
	Level       int
	Msg         *[]byte
	Raw         bool
	FileName    string
	FuncName    string
	Line        int
	GoroutineId string
	ThreadId    string
	TrackLine   bool
	TrackThread bool
	Tag         string
}

type LogWriter added in v1.0.6

type LogWriter struct {
}

func (*LogWriter) Write added in v1.0.6

func (l *LogWriter) Write(p []byte) (n int, err error)

type Logger

type Logger struct {
	FileTagMap    map[string]*os.File
	LastLogTime   time.Time
	LogInfoChan   chan *LogInfo
	WriteBuf      []byte
	WriteCacheNum int32
	CloseChan     chan struct{}
}

Jump to

Keyboard shortcuts

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