rlog

package
v0.0.32 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LevelDebug = iota
	LevelInfo
	LevelSuccess
	LevelWarn
	LevelError
	LevelPanic

	LevelDisable = 100
)

Variables

This section is empty.

Functions

func ConsoleOnly added in v0.0.28

func ConsoleOnly() *_configPlus

ConsoleOnly 只打印控制台日志

func Debug

func Debug(a ...any)

func DoNotPrint added in v0.0.28

func DoNotPrint() *_configPlus

DoNotPrint 不打印任何日志

func Error

func Error(a ...any)

func FileOnly added in v0.0.28

func FileOnly() *_configPlus

FileOnly 只打印文件日志

func Info

func Info(a ...any)

func NewLog added in v0.0.28

func NewLog(logFilePath string, consoleLogLevel Level, fileLogLevel Level) *_config

NewLog 创建一个日志客户端

func Panic

func Panic(a ...any)

func Print added in v0.0.28

func Print(a ...any)

func Printf added in v0.0.28

func Printf(format string, a ...any)

func Println added in v0.0.28

func Println(a ...any)

func SetCodePathEllipsisLength added in v0.0.28

func SetCodePathEllipsisLength(length int)

SetCodePathEllipsisLength 代码路径省略长度

func SetConsoleLogLevel added in v0.0.28

func SetConsoleLogLevel(consoleLogLevel Level)

SetConsoleLogLevel 设置打印控制台的日志级别

func SetDoNotCodePath added in v0.0.28

func SetDoNotCodePath(doNotPrint bool)

SetDoNotCodePath 设置是否不打印代码路径

func SetFileLogLevel added in v0.0.28

func SetFileLogLevel(fileLogLevel Level)

SetFileLogLevel 设置打印文件的日志级别

func SetLogFilePath

func SetLogFilePath(logFilePath string)

SetLogFilePath 设置日志文件路径

func SetLogMaxSize added in v0.0.28

func SetLogMaxSize(max int64)

SetLogMaxSize 设置日志文件最大大小,超过该值将切割文件

func SetOldLogZip added in v0.0.28

func SetOldLogZip(openZip bool)

SetOldLogZip 设置切割日志文件时,旧日志文件是否开启zip压缩保存

func SetPrefixTimeFormat added in v0.0.28

func SetPrefixTimeFormat(format TimeFormat)

SetPrefixTimeFormat 设置日志打印的时间前缀

func SetPrintConsole added in v0.0.28

func SetPrintConsole(isPrint bool)

SetPrintConsole 设置是否打印到控制台

func SetPrintFile added in v0.0.28

func SetPrintFile(isPrint bool)

SetPrintFile 设置是否打印到文件

func SetPrintFunc added in v0.0.32

func SetPrintFunc(fx func(a ...any) (n int, err error))

SetPrintFunc 设置打印到控制台的函数,默认为 fmt.Print

func Success added in v0.0.5

func Success(a ...any)

func WaitFinish added in v0.0.5

func WaitFinish()

WaitFinish 安全结束日志打印

func Warn

func Warn(a ...any)

Types

type Level added in v0.0.28

type Level byte

type TimeFormat added in v0.0.28

type TimeFormat string
const (
	// TimeFormatDefault 输出日志,前面时间的格式
	TimeFormatDefault   TimeFormat = `2006/01/02·15:04:05.000-0700`
	TimeFormatYMDHMSmsZ TimeFormat = `2006/01/02·15:04:05.000-0700`
	TimeFormatYMDHMSZ   TimeFormat = `2006/01/02·15:04:05-0700`
	TimeFormatYMDHMS    TimeFormat = `2006/01/02·15:04:05`
	TimeFormatYMDHMSms  TimeFormat = `2006/01/02·15:04:05.000`
	TimeFormatMDHMSmsZ  TimeFormat = `01/02·15:04:05.000-0700`
	TimeFormatMDHMSZ    TimeFormat = `01/02·15:04:05-0700`
	TimeFormatMDHMS     TimeFormat = `01/02·15:04:05`
	TimeFormatMDHMSms   TimeFormat = `01/02·15:04:05.000`
	TimeFormatHMSmsZ    TimeFormat = `15:04:05.000-0700`
	TimeFormatHMSZ      TimeFormat = `15:04:05-0700`
	TimeFormatHMS       TimeFormat = `15:04:05`
	TimeFormatHMSms     TimeFormat = `15:04:05.000`
)

Jump to

Keyboard shortcuts

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