Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
ff987cff
Commit
ff987cff
authored
Nov 03, 2014
by
Matt Bell
Committed by
Juan Batiz-Benet
Nov 14, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
core/commands2: Added 'log' command
parent
3c4e7bf9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
+29
-0
core/commands2/log.go
core/commands2/log.go
+28
-0
core/commands2/root.go
core/commands2/root.go
+1
-0
No files found.
core/commands2/log.go
0 → 100644
View file @
ff987cff
package
commands
import
(
"fmt"
cmds
"github.com/jbenet/go-ipfs/commands"
u
"github.com/jbenet/go-ipfs/util"
)
var
logCmd
=
&
cmds
.
Command
{
Arguments
:
[]
cmds
.
Argument
{
cmds
.
Argument
{
"subsystem"
,
cmds
.
ArgString
,
true
,
false
},
cmds
.
Argument
{
"level"
,
cmds
.
ArgString
,
true
,
false
},
},
Help
:
"TODO"
,
Run
:
func
(
res
cmds
.
Response
,
req
cmds
.
Request
)
{
args
:=
req
.
Arguments
()
if
err
:=
u
.
SetLogLevel
(
args
[
0
]
.
(
string
),
args
[
1
]
.
(
string
));
err
!=
nil
{
res
.
SetError
(
err
,
cmds
.
ErrClient
)
return
}
s
:=
fmt
.
Sprintf
(
"Changed log level of '%s' to '%s'"
,
args
[
0
],
args
[
1
])
res
.
SetValue
(
&
MessageOutput
{
s
})
},
Format
:
MessageFormatter
,
Type
:
&
MessageOutput
{},
}
core/commands2/root.go
View file @
ff987cff
...
...
@@ -61,6 +61,7 @@ var rootSubcommands = map[string]*cmds.Command{
"commands"
:
commandsCmd
,
"publish"
:
publishCmd
,
"add"
:
addCmd
,
"log"
:
logCmd
,
// test subcommands
// TODO: remove these when we don't need them anymore
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment