style: 变量命名
This commit is contained in:
@@ -20,18 +20,18 @@ func initLog() {
|
||||
if !strings.HasSuffix(Settings.Log.FilePath, "/") {
|
||||
Settings.Log.FilePath += "/"
|
||||
}
|
||||
e := os.MkdirAll(Settings.Log.FilePath, os.ModePerm)
|
||||
if e != nil {
|
||||
log.Fatalln(e)
|
||||
err := os.MkdirAll(Settings.Log.FilePath, os.ModePerm)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
if Settings.Log.FileName == "" {
|
||||
Settings.Log.FileName = time.Now().Format("2006.01.02-15.04.05") + ".log"
|
||||
}
|
||||
|
||||
f, e := os.OpenFile(Settings.Log.FilePath+Settings.Log.FileName, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644)
|
||||
if e != nil {
|
||||
log.Fatalln(e)
|
||||
f, err := os.OpenFile(Settings.Log.FilePath+Settings.Log.FileName, os.O_WRONLY|os.O_CREATE|os.O_APPEND, 0644)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
//设置双重输出
|
||||
|
||||
Reference in New Issue
Block a user