fix(misc) address PR comments
License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
Brian Tiger Chow committed
Nov 16, 2014 at 07:40 UTC
1c4c7412b44a48d9e502976558a0a36cb4d8bebf
2 files changed
+4
-10
cmd/ipfs2/main.go
+4
-4
@@ -205,12 +205,12 @@ func (i *cmdInvocation) requestedHelp() (short bool, long bool, err error) {
205
return longHelp, shortHelp, nil
206
}
207
208
-func callPreCommandHooks(command cmdDetails, req cmds.Request, root *cmds.Command) error {
208
+func callPreCommandHooks(details cmdDetails, req cmds.Request, root *cmds.Command) error {
209
210
log.Debug("Calling pre-command hooks...")
211
212
// some hooks only run when the command is executed locally
213
- daemon, err := commandShouldRunOnDaemon(command, req, root)
213
+ daemon, err := commandShouldRunOnDaemon(details, req, root)
214
if err != nil {
215
return err
216
}
@@ -218,7 +218,7 @@ func callPreCommandHooks(command cmdDetails, req cmds.Request, root *cmds.Comman
218
// check for updates when 1) commands is going to be run locally, 2) the
219
// command does not initialize the config, and 3) the command does not
220
// pre-empt updates
221
- if !daemon && command.usesConfigAsInput() && command.doesNotPreemptAutoUpdate() {
221
+ if !daemon && details.usesConfigAsInput() && details.doesNotPreemptAutoUpdate() {
222
223
log.Debug("Calling hook: Check for updates")
224
@@ -234,7 +234,7 @@ func callPreCommandHooks(command cmdDetails, req cmds.Request, root *cmds.Comman
234
235
// When the upcoming command may use the config and repo, we know it's safe
236
// for the log config hook to touch the config/repo
237
- if command.usesConfigAsInput() && command.usesRepo() {
237
+ if details.usesConfigAsInput() && details.usesRepo() {
238
log.Debug("Calling hook: Configure Event Logger")
239
cfg, err := req.Context().GetConfig()
240
if err != nil {
routing/dht/dht.go
-6
@@ -152,10 +152,7 @@ func (dht *IpfsDHT) HandleMessage(ctx context.Context, mes msg.NetMessage) msg.N
152
// update the peer (on valid msgs only)
153
dht.Update(mPeer)
154
155
- // Print out diagnostic
155
log.Event(ctx, "foo", dht.self, mPeer, pmes)
157
- log.Debugf("%s got message type: '%s' from %s",
158
- dht.self, pb.Message_MessageType_name[int32(pmes.GetType())], mPeer)
156
157
// get handler for this msg type.
158
handler := dht.handlerForMsgType(pmes.GetType())
@@ -198,10 +195,7 @@ func (dht *IpfsDHT) sendRequest(ctx context.Context, p peer.Peer, pmes *pb.Messa
195
196
start := time.Now()
197
201
- // Print out diagnostic
198
log.Event(ctx, "sentMessage", dht.self, p, pmes)
203
- log.Debugf("Sent message type: '%s' to %s",
204
- pb.Message_MessageType_name[int32(pmes.GetType())], p)
199
200
rmes, err := dht.sender.SendRequest(ctx, mes)
201
if err != nil {