debug(2/ipfs) make cmdDetails loggable
License: MIT Signed-off-by: Brian Tiger Chow <brian@perfmode.com> # TYPES # feat # fix # docs # style (formatting, missing semi colons, etc; no code change): # refactor # test (adding missing tests, refactoring tests; no production code change) # chore (updating grunt tasks etc; no production code change) Signed-off-by: Brian Tiger Chow <brian.holderchow@gmail.com>
Brian Tiger Chow committed
Nov 16, 2014 at 13:15 UTC
81f5d6fd5f15fafd11e174d765721711bf3f3691
1 file changed
+10
cmd/ipfs2/ipfs.go
+10
@@ -76,6 +76,16 @@ func (d *cmdDetails) String() string {
76
d.canRunOnClient(), d.canRunOnDaemon(), d.usesRepo())
77
}
78
79
+func (d *cmdDetails) Loggable() map[string]interface{} {
80
+ return map[string]interface{}{
81
+ "canRunOnClient": d.canRunOnClient(),
82
+ "canRunOnDaemon": d.canRunOnDaemon(),
83
+ "preemptsAutoUpdate": d.preemptsAutoUpdate,
84
+ "usesConfigAsInput": d.usesConfigAsInput(),
85
+ "usesRepo": d.usesRepo(),
86
+ }
87
+}
88
+
89
func (d *cmdDetails) usesConfigAsInput() bool { return !d.doesNotUseConfigAsInput }
90
func (d *cmdDetails) doesNotPreemptAutoUpdate() bool { return !d.preemptsAutoUpdate }
91
func (d *cmdDetails) canRunOnClient() bool { return !d.cannotRunOnClient }