-
Notifications
You must be signed in to change notification settings - Fork 0
/
logging.go
40 lines (31 loc) · 967 Bytes
/
logging.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package clilogging
import (
"fmt"
"github.com/hyperledger/fabric/common/flogging"
"github.com/hyperledger/fabric/internal/peer/common"
"github.com/spf13/cobra"
)
const (
loggingFuncName = "logging"
loggingCmdDes = "Logging configuration: getlevel|setlevel|getlogspec|setlogspec|revertlevels."
)
var logger = flogging.MustGetLogger("cli.logging")
// Cmd returns the cobra command for Logging
func Cmd(cf *LoggingCmdFactory) *cobra.Command {
loggingCmd.AddCommand(getLevelCmd(cf))
loggingCmd.AddCommand(setLevelCmd(cf))
loggingCmd.AddCommand(revertLevelsCmd(cf))
loggingCmd.AddCommand(getLogSpecCmd(cf))
loggingCmd.AddCommand(setLogSpecCmd(cf))
return loggingCmd
}
var loggingCmd = &cobra.Command{
Use: loggingFuncName,
Short: fmt.Sprint(loggingCmdDes),
Long: fmt.Sprint(loggingCmdDes),
PersistentPreRun: common.InitCmd,
}