Discover Packages
github.com/huoxue1/leafbot
utils
package
Version:
v1.1.9
Opens a new window with list of versions in this module.
Published: Jul 3, 2022
License: AGPL-3.0
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 2 modules, 1 package
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
Documentation
Documentation
¶
Package utils
@Description:
GetLogLevel 获取日志等级
可能的值有
"trace","debug","info","warn","warn","error"
PathExists
*
@Description:
判断文件或文件夹是否存在
如果返回的错误为nil,说明文件或文件夹存在
如果返回的错误类型使用os.IsNotExist()判断为true,说明文件或文件夹不存在
如果返回的错误为其它类型,则不确定是否在存在
@param path
@return bool
@return error
example
type LogFormat struct {
TimeStampFormat string `json:"time_stamp_format"`
LogContent string `json:"log_content"`
LogTruncate bool `json:"log_truncate"`
}
Format
*
@Description:
@receiver f
@param entry
@return []byte
@return error
example
type LogHook struct {
EnableLogChan bool
LogChan chan string
}
LogHook
@Description:
NewLogHook
*
@Description:
@param formatter
@param levels
@param writers
@return *LogHook
example
AddWriter
*
@Description:
@receiver l
@param writer
example
Fire
*
@Description:
@receiver l
@param entry
@return error
example
Levels
*
@Description:
@receiver l
@return []log.Level
example
SetFormat
*
@Description:
@receiver l
@param format
example
Source Files
¶
Click to show internal directories.
Click to hide internal directories.