修复 panic

This commit is contained in:
dengsgo 2020-01-02 18:22:16 +08:00
parent bb80977213
commit 7d2e8dd34d
2 changed files with 8 additions and 4 deletions

View File

@ -270,15 +270,15 @@ func parseArgs() {
if err != nil {
logAndExit(err)
}
logInfo("PID:", pid)
logInfo("fileboy is ready. the main process will run as a daemons")
logUInfo("PID:", pid)
logUInfo("fileboy is ready. the main process will run as a daemons")
return
case "stop":
err := stopDeamon()
if err != nil {
logAndExit(err)
}
logInfo("fileboy daemon is stoped.")
logUInfo("fileboy daemon is stoped.")
return
case "init":
_, err := ioutil.ReadFile(getFileGirlPath())
@ -291,7 +291,7 @@ func parseArgs() {
logError("Profile filegirl.yaml create failed! ", err)
return
}
logInfo("Profile filegirl.yaml created ok")
logUInfo("Profile filegirl.yaml created ok")
return
case "exec":
parseConfig()

View File

@ -85,6 +85,10 @@ func logInfo(v ...interface{}) {
if keyInInstruction(InstIgnoreInfo) {
return
}
logUInfo(v...)
}
func logUInfo(v ...interface{}) {
v = append([]interface{}{"I:"}, v...)
log.Println(v...)
}