Documentation ¶
Index ¶
- Constants
- func ConsoleOnly() *_configPlus
- func Debug(a ...any)
- func DoNotPrint() *_configPlus
- func Error(a ...any)
- func FileOnly() *_configPlus
- func Info(a ...any)
- func NewLog(logFilePath string, consoleLogLevel Level, fileLogLevel Level) *_config
- func Panic(a ...any)
- func Print(a ...any)
- func Printf(format string, a ...any)
- func Println(a ...any)
- func SetCodePathEllipsisLength(length int)
- func SetConsoleLogLevel(consoleLogLevel Level)
- func SetDoNotCodePath(doNotPrint bool)
- func SetFileLogLevel(fileLogLevel Level)
- func SetLogFilePath(logFilePath string)
- func SetLogMaxSize(max int64)
- func SetOldLogZip(openZip bool)
- func SetPrefixTimeFormat(format TimeFormat)
- func SetPrintConsole(isPrint bool)
- func SetPrintFile(isPrint bool)
- func SetPrintFunc(fx func(a ...any) (n int, err error))
- func Success(a ...any)
- func WaitFinish()
- func Warn(a ...any)
- type Level
- type TimeFormat
Constants ¶
View Source
const ( LevelDebug = iota LevelInfo LevelSuccess LevelWarn LevelError LevelPanic LevelDisable = 100 )
Variables ¶
This section is empty.
Functions ¶
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 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 SetPrintFunc ¶ added in v0.0.32
SetPrintFunc 设置打印到控制台的函数,默认为 fmt.Print
Types ¶
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` )
Click to show internal directories.
Click to hide internal directories.