fehlerbehebung
This commit is contained in:
parent
8c91566b09
commit
e278c6f851
8
file.go
8
file.go
|
@ -40,3 +40,11 @@ func fileCreate(filepath string) {
|
||||||
logger("fileCreate : unknown -> " + filepath)
|
logger("fileCreate : unknown -> " + filepath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func fileMkDir(folderpath string) {
|
||||||
|
_, err := os.Stat(folderpath)
|
||||||
|
if errors.Is(err, os.ErrNotExist) {
|
||||||
|
err = os.Mkdir(folderpath, 0755)
|
||||||
|
errorPanic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,13 +1,11 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"os"
|
|
||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func logger(input string) {
|
func logger(input string) {
|
||||||
err := os.Mkdir("./log", 0755)
|
fileMkDir("./log")
|
||||||
errorPanic(err)
|
|
||||||
println("[" + time.Now().Format("15:04:05") + "] " + input)
|
println("[" + time.Now().Format("15:04:05") + "] " + input)
|
||||||
fileAddLine("["+time.Now().Format("15:04:05")+"] "+input, "./log/"+time.Now().Format("2006-02-01")+".log")
|
fileAddLine("["+time.Now().Format("15:04:05")+"] "+input, "./log/"+time.Now().Format("2006-02-01")+".log")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue