logger

package
v0.0.0-...-716261e Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2024 License: GPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RED    = "\033[31m"
	YELLOW = "\033[33m"
	CYAN   = "\033[36m"
	WHITE  = "\033[37m"
)

ANSI转义码颜色常量

Variables

This section is empty.

Functions

This section is empty.

Types

type LogFormatter

type LogFormatter struct {
}

LogFormatter 日志格式化工具

type LogLevel

type LogLevel int
const (
	DEBUG   LogLevel = 1
	INFO    LogLevel = 2
	WARNING LogLevel = 3
	ERROR   LogLevel = 4
)

日志级别常量

type Logger

type Logger struct {
	Level     LogLevel
	LogPath   string
	Formatter LogFormatter
	// contains filtered or unexported fields
}

Logger 日志打印封装

func DefaultLogger

func DefaultLogger() *Logger

func NewLogger

func NewLogger() *Logger

func (*Logger) Debug

func (l *Logger) Debug(msg any)

func (*Logger) Error

func (l *Logger) Error(msg any)

func (*Logger) Info

func (l *Logger) Info(msg any)

func (*Logger) SetLogPath

func (l *Logger) SetLogPath(logPath string)

func (*Logger) Warning

func (l *Logger) Warning(msg any)

Jump to

Keyboard shortcuts

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