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 ( ...@@ -5,8 +5,11 @@ import (
"strings" "strings"
cmds "github.com/jbenet/go-ipfs/commands" cmds "github.com/jbenet/go-ipfs/commands"
u "github.com/jbenet/go-ipfs/util"
) )
var log = u.Logger("core/commands")
type TestOutput struct { type TestOutput struct {
Foo string Foo string
Bar int Bar int
...@@ -64,6 +67,7 @@ var rootSubcommands = map[string]*cmds.Command{ ...@@ -64,6 +67,7 @@ var rootSubcommands = map[string]*cmds.Command{
"beep": &cmds.Command{ "beep": &cmds.Command{
Run: func(res cmds.Response, req cmds.Request) { Run: func(res cmds.Response, req cmds.Request) {
v := &TestOutput{"hello, world", 1337} v := &TestOutput{"hello, world", 1337}
log.Info("beep")
res.SetValue(v) res.SetValue(v)
}, },
Format: func(res cmds.Response) (string, error) { Format: func(res cmds.Response) (string, error) {
...@@ -108,4 +112,5 @@ var rootSubcommands = map[string]*cmds.Command{ ...@@ -108,4 +112,5 @@ var rootSubcommands = map[string]*cmds.Command{
func init() { func init() {
Root.Subcommands = rootSubcommands 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