Documentation
¶
Index ¶
- Constants
- func Debug(a ...any)
- func Error(a ...any)
- func ExitError(a ...any)
- func ExitErrorAndSleep3(a ...any)
- func Info(a ...any)
- func Init()
- func Panic(a ...any)
- func Print(a ...any)
- func Printf(format string, a ...any)
- func Println(a ...any)
- func PrintlnConsoleMust(a ...any)
- func PrintlnConsoleMustOnly(a ...any)
- func PrintlnFileMust(a ...any)
- func PrintlnFileMustOnly(a ...any)
- func ProjectDir() string
- func SetAutoDeleteOldLogFile(day uint)
- func SetConsoleLevel(level Level)
- func SetFileLevel(level Level)
- func SetFullTextStaining(full bool)
- func SetLogFileMaxSize(mb uint)
- func SetLogFilePath(filepath string, oldLogToZip bool)
- func Success(a ...any)
- func WaitFinish()
- func Warn(a ...any)
- type Level
- type RLogger
Constants ¶
View Source
const ( LevelDebug = iota LevelInfo LevelSuccess LevelWarn LevelError LevelPanic LevelDisable = 100 )
View Source
const ( LogFileModel = 0660 DefaultLogFileMaxSize = 1024 * 1024 * 10 )
Variables ¶
This section is empty.
Functions ¶
func ExitErrorAndSleep3 ¶ added in v0.0.53
func ExitErrorAndSleep3(a ...any)
func PrintlnConsoleMust ¶ added in v0.0.49
func PrintlnConsoleMust(a ...any)
PrintlnConsoleMust 强制打印到控制台日志
func PrintlnConsoleMustOnly ¶ added in v0.0.49
func PrintlnConsoleMustOnly(a ...any)
PrintlnConsoleMustOnly 强制只打印到控制台日志
func PrintlnFileMustOnly ¶ added in v0.0.49
func PrintlnFileMustOnly(a ...any)
PrintlnFileMustOnly 强制只打印到文件
func SetAutoDeleteOldLogFile ¶ added in v0.0.42
func SetAutoDeleteOldLogFile(day uint)
SetAutoDeleteOldLogFile 设置自动删除多少天前的日志
func SetConsoleLevel ¶ added in v0.0.42
func SetConsoleLevel(level Level)
SetConsoleLevel 设置控制台日志打印等级
func SetFullTextStaining ¶ added in v0.0.42
func SetFullTextStaining(full bool)
SetFullTextStaining 设置是否全文着色,默认false:tag 着色。
func SetLogFileMaxSize ¶ added in v0.0.49
func SetLogFileMaxSize(mb uint)
SetLogFileMaxSize 设置日志文件最大大小,MB
func SetLogFilePath ¶
SetLogFilePath 设置日志文件路径
Types ¶
type RLogger ¶ added in v0.0.42
type RLogger interface {
Print(a ...any)
Println(a ...any)
Printf(format string, a ...any)
Debug(a ...any)
Info(a ...any)
Success(a ...any)
Warn(a ...any)
Error(a ...any)
Panic(a ...any)
ExitError(a ...any) //退出程序并且打印错误,并且立即退出关闭程序,os.Exit(1)。
ExitErrorAndSleep3(a ...any) //退出程序并且打印错误,延时3秒后退出关闭程序,os.Exit(1)。
PrintlnConsoleMust(a ...any) //强制打印到控制台日志
PrintlnFileMust(a ...any) //强制打印到文件
PrintlnConsoleMustOnly(a ...any) //强制只打印到控制台日志
PrintlnFileMustOnly(a ...any) //强制只打印到文件
SetLogFilePath(filepath string, oldLogToZip bool) //设置日志文件路径
SetConsoleLevel(level Level) //设置控制台日志打印等级
SetFileLevel(level Level) //设置文件日志打印等级
SetFullTextStaining(full bool) //设置是否全文着色,默认false:tag 着色。
SetAutoDeleteOldLogFile(day uint) //设置自动删除多少天前的日志
SetLogFileMaxSize(mb uint) //设置日志文件最大大小,MB
// contains filtered or unexported methods
}
Click to show internal directories.
Click to hide internal directories.