log_helper

package
v0.55.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OnceSubsScanStart = "OneTimeSubtitleScanStart"
	OnceSubsScanEnd   = "OneTimeSubtitleScanEnd"
)
View Source
const (
	LogNameChineseSubFinder    = "ChineseSubFinder"
	LogNameGetCAPTCHA          = "GetCAPTCHA"
	LogNameBackEnd             = "BackEnd"
	LogNameCliSubTimelineFixer = "SubTimelineFixer"
)
View Source
const DebugFileName = "opendebuglog"

Variables

This section is empty.

Functions

func CleanAndLoadOnceLogs

func CleanAndLoadOnceLogs()

CleanAndLoadOnceLogs 调用的时机,一定是要在新开一个日志前,且把上一个日志的文件流关闭的时候

func DeleteDebugFile

func DeleteDebugFile() error

DeleteDebugFile 删除开启 Debug 级别日志记录的特殊文件

func GetLogger4Tester

func GetLogger4Tester() *logrus.Logger

func GetOnceLog4Running

func GetOnceLog4Running() *log_hub.OnceLog

GetOnceLog4Running 当前正在运行任务的日志

func GetSpiltOnceLog

func GetSpiltOnceLog(log *log_hub.OnceLog) []*log_hub.OnceLog

GetSpiltOnceLog 拆分到一行一个,没有锁,所以需要考虑并发问题

func NewLogHelper

func NewLogHelper(appName string, logStorePath string, level logrus.Level, maxAge time.Duration, rotationTime time.Duration, extendLog ...settings.ExtendLog) *logrus.Logger

func WriteDebugFile

func WriteDebugFile() error

WriteDebugFile 写入开启 Debug 级别日志记录的特殊文件,注意这个最好是在主程序中调用,这样就跟主程序在一个目录下生成,log 去检测是否存在才有意义

Types

type LoggerHub

type LoggerHub struct {
	// contains filtered or unexported fields
}

func NewLoggerHub

func NewLoggerHub() *LoggerHub

func (*LoggerHub) Fire

func (lh *LoggerHub) Fire(entry *logrus.Entry) error

func (*LoggerHub) Levels

func (lh *LoggerHub) Levels() []logrus.Level

Jump to

Keyboard shortcuts

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