From 7d2e8dd34d785a7e621405a4ad8c206df2a403ff Mon Sep 17 00:00:00 2001 From: dengsgo Date: Thu, 2 Jan 2020 18:22:16 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20panic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- fileboy.go | 8 ++++---- util.go | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/fileboy.go b/fileboy.go index 03fbd9a..6ec4217 100644 --- a/fileboy.go +++ b/fileboy.go @@ -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() diff --git a/util.go b/util.go index d44c2eb..c7ebd99 100644 --- a/util.go +++ b/util.go @@ -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...) }