Documentation ¶
Index ¶
- Constants
- func Debug(v ...any)
- func DebugP(model PrintModel, v ...any)
- func Error(v ...any)
- func ErrorP(model PrintModel, v ...any)
- func GetCropPathLength() uint
- func Info(v ...any)
- func InfoP(model PrintModel, v ...any)
- func Panic(v ...any)
- func PanicP(model PrintModel, v ...any)
- func SetAutoRemoveLogFile(day uint)
- func SetCropPathLength(length int)
- func SetLogFile(logDir string, fileMaxSize int64, isOneFile bool)
- func SetLogLevel(Console LogLeve, File LogLeve)
- func SetLogTimeFormat(format LogTimeFormat)
- func SetPrintCodeFilePath(printCode bool)
- func Success(v ...any)
- func SuccessP(model PrintModel, v ...any)
- func WaitFinish()
- func Warn(v ...any)
- func WarnP(model PrintModel, v ...any)
- type LogLeve
- type LogTimeFormat
- type PrintModel
Constants ¶
View Source
const ( ModelNoPath PrintModel = 1 //不打印代码文件路径及行号 ModelNoTime PrintModel = 2 //不打印日期、时间、时区 ModelNoPathTime PrintModel = 3 //不打印代码文件路径及行号、不打印日期、时间、时区 ModelMustConsole PrintModel = 4 //必须打印控制台日志 ModelNoConsole PrintModel = 5 //不打印到控制台 ModelMustFile PrintModel = 6 //必须打印到文件日志 ModelNoFile PrintModel = 7 //不打印到文件 ModelMustAll PrintModel = 8 //必须打印到控制台日志和文件日志 LogLevelDebug LogLeve = 0 //日志等级debug,该等级打印所有级别的日志 LogLevelInfo LogLeve = 1 //日志等级info,该等级仅不打印debug日志 LogLeveSuccess LogLeve = 2 //日志等级success,该等级仅不打印debug,info日志 LogLevelWarn LogLeve = 3 //日志等级warn,该等级仅不打印debug,info,success日志 LogLevelError LogLeve = 4 //日志等级Error,该等级仅不打印debug,info,success,warn日志 LogLevelPanic LogLeve = 5 //日志等级Panic,该等级仅不打印debug,info,success,warn,error日志 LogLevelNotPrint LogLeve = 6 //日志等级最高,该等级不打印任何日志 // TimeFormatDefault 输出日志,前面时间的格式 TimeFormatDefault LogTimeFormat = `2006/01/02·15:04:05.000-0700 ` TimeFormatYMDHMSmsZ LogTimeFormat = `2006/01/02·15:04:05.000-0700 ` TimeFormatYMDHMSZ LogTimeFormat = `2006/01/02·15:04:05-0700 ` TimeFormatYMDHMS LogTimeFormat = `2006/01/02·15:04:05 ` TimeFormatYMDHMSms LogTimeFormat = `2006/01/02·15:04:05.000 ` TimeFormatMDHMSmsZ LogTimeFormat = `01/02·15:04:05.000-0700 ` TimeFormatMDHMSZ LogTimeFormat = `01/02·15:04:05-0700 ` TimeFormatMDHMS LogTimeFormat = `01/02·15:04:05 ` TimeFormatMDHMSms LogTimeFormat = `01/02·15:04:05.000 ` TimeFormatHMSmsZ LogTimeFormat = `15:04:05.000-0700 ` TimeFormatHMSZ LogTimeFormat = `15:04:05-0700 ` TimeFormatHMS LogTimeFormat = `15:04:05 ` TimeFormatHMSms LogTimeFormat = `15:04:05.000 ` )
Variables ¶
This section is empty.
Functions ¶
func DebugP ¶ added in v0.0.5
func DebugP(model PrintModel, v ...any)
func ErrorP ¶ added in v0.0.5
func ErrorP(model PrintModel, v ...any)
func GetCropPathLength ¶ added in v0.0.5
func GetCropPathLength() uint
GetCropPathLength 获取项目文件夹路径字符长度
func InfoP ¶ added in v0.0.5
func InfoP(model PrintModel, v ...any)
func PanicP ¶ added in v0.0.5
func PanicP(model PrintModel, v ...any)
func SetCropPathLength ¶ added in v0.0.5
func SetCropPathLength(length int)
SetCropPathLength 设置去除日志代码文件路径前面多少个字符
func SetLogFile ¶ added in v0.0.5
SetLogFile 设置日志文件路径
func SetLogLevel ¶ added in v0.0.5
SetLogLevel 设置基本配置信息 Console:打印到控制台的日志等级 File:打印到文件的日志等级
func SetLogTimeFormat ¶ added in v0.0.16
func SetLogTimeFormat(format LogTimeFormat)
SetLogTimeFormat 设置输出日志,前面时间的格式
func SetPrintCodeFilePath ¶ added in v0.0.5
func SetPrintCodeFilePath(printCode bool)
SetPrintCodeFilePath 设置是否打印代码文件路径,默认打印
func SuccessP ¶ added in v0.0.5
func SuccessP(model PrintModel, v ...any)
func WarnP ¶ added in v0.0.5
func WarnP(model PrintModel, v ...any)
Types ¶
type LogTimeFormat ¶ added in v0.0.16
type LogTimeFormat string
type PrintModel ¶ added in v0.0.5
type PrintModel uint8
Click to show internal directories.
Click to hide internal directories.