logs(2/main) place log statements approppriately

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
This commit is contained in:
Brian Tiger Chow 2014-11-15 18:31:52 -08:00
parent 4b1607819f
commit 55896a86d6

View File

@ -353,13 +353,15 @@ func commandShouldRunOnDaemon(details cmdDetails, req cmds.Request, root *cmds.C
return false, nil
}
log.Info("looking for running daemon...")
// at this point need to know whether daemon is running. we defer
// to this point so that some commands dont open files unnecessarily.
daemonLocked := daemon.Locked(req.Context().ConfigRoot)
log.Info("Daemon is running.")
if daemonLocked {
log.Info("a daemon is running...")
if details.cannotRunOnDaemon {
e := "ipfs daemon is running. please stop it to run this command"
return false, cmds.ClientError(e)