Commit 92e308f3 authored by Matt Bell's avatar Matt Bell Committed by Juan Batiz-Benet

core/commands2: Added logging

parent 38318a6c
......@@ -5,8 +5,11 @@ import (
"strings"
cmds "github.com/jbenet/go-ipfs/commands"
u "github.com/jbenet/go-ipfs/util"
)
var log = u.Logger("core/commands")
type TestOutput struct {
Foo string
Bar int
......@@ -64,6 +67,7 @@ var rootSubcommands = map[string]*cmds.Command{
"beep": &cmds.Command{
Run: func(res cmds.Response, req cmds.Request) {
v := &TestOutput{"hello, world", 1337}
log.Info("beep")
res.SetValue(v)
},
Format: func(res cmds.Response) (string, error) {
......@@ -108,4 +112,5 @@ var rootSubcommands = map[string]*cmds.Command{
func init() {
Root.Subcommands = rootSubcommands
u.SetLogLevel("core/commands", "info")
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment