logger

package
v0.0.0-...-c3f54fb Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Reset  = "\033[0m"
	Red    = "\033[31m"
	Green  = "\033[32m"
	Blue   = "\033[34m"
	Yellow = "\033[33m"
)

Variables

This section is empty.

Functions

func Debug

func Debug(v ...any)

***********外部调用的日志函数***************

func Debugf

func Debugf(format string, v ...any)

func Error

func Error(v ...any)

func Errorf

func Errorf(format string, v ...any)

func Fatal

func Fatal(v ...any)

func Fatalf

func Fatalf(format string, v ...any)

func Info

func Info(v ...any)

func Infof

func Infof(format string, v ...any)

func SetLoggerLevel

func SetLoggerLevel(logLevel LogLevel)

设置日志级别

func Setup

func Setup(settings *Settings)

程序初始运行的时候调用

func Warn

func Warn(v ...any)

func Warnf

func Warnf(format string, v ...any)

Types

type LogLevel

type LogLevel int

日志级别

const (
	NULL LogLevel = iota

	FATAL
	ERROR
	WARN
	INFO
	DEBUG
)

type Settings

type Settings struct {
	Path       string `yaml:"path"`        // 路径
	Name       string `yaml:"name"`        // 文件名
	Ext        string `yaml:"ext"`         // 文件后缀
	DateFormat string `yaml:"date-format"` // 日期格式
}

config for logger example: redis-20231225.log

Jump to

Keyboard shortcuts

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