utils

package
v0.0.0-...-4167ae3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2023 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogFatalLevel = LogArg(logrus.FatalLevel)
	LogErrorLevel = LogArg(logrus.ErrorLevel)
	LogWarnLevel  = LogArg(logrus.WarnLevel)
	LogInfoLevel  = LogArg(logrus.InfoLevel)
	LogDebugLevel = LogArg(logrus.DebugLevel)
	LogTraceLevel = LogArg(logrus.TraceLevel)

	LogWithStack LogArg = 0x08
)

Variables

This section is empty.

Functions

func FileExist

func FileExist(path string) (bool, error)

FileExist 判断文件是否存在

func GetModuleLogger

func GetModuleLogger(name string) logrus.FieldLogger

GetModuleLogger - 提供一个为 Module 使用的 logrus.Entry 包含 logrus.Fields

func ReadFile

func ReadFile(path string) []byte

ReadFile 读取文件 读取失败返回 nil

func WriteLogToFS

func WriteLogToFS(args ...LogArg)

WriteLogToFS 将日志转储至文件 请务必在 init() 阶段调用此函数 否则会出现日志缺失 日志存储位置 ./logs

func WriteLogToPath

func WriteLogToPath(p string, args ...LogArg)

WriteLogToPath 将日志转储至文件 请务必在 init() 阶段调用此函数 否则会出现日志缺失 日志存储位置 p

Types

type LogArg

type LogArg uint32

Jump to

Keyboard shortcuts

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