Finish refining all the logger things.

This commit is contained in:
zicla
2018-11-30 15:32:28 +08:00
parent 4af940647d
commit 6485e3b48e
19 changed files with 162 additions and 146 deletions

View File

@ -87,6 +87,26 @@ func GetConfPath() string {
return filePath
}
//获取日志的路径
//例如:默认存放于 home/log
func GetLogPath() string {
homePath := GetHomePath()
filePath := homePath + "/log"
exists, err := PathExists(filePath)
if err != nil {
panic("判断日志文件夹是否存在时出错!")
}
if !exists {
err = os.MkdirAll(filePath, 0777)
if err != nil {
panic("创建日志文件夹时出错!")
}
}
return filePath
}
//获取某个用户文件应该存放的位置。这个是相对GetFilePath的路径
//例如:/zicla/2006-01-02/1510122428000
func GetUserFilePath(username string, cache bool) (string, string) {