Skip to content

Commit

Permalink
next round of PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
holisticode committed Aug 12, 2022
1 parent fecd0ca commit 11b925f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
7 changes: 5 additions & 2 deletions cmd/control/control.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,18 @@ func NewCommand() *cobra.Command {
newGetSnapshotNamesCommand(),
)

lvl, err := logging.ToLevel(logLevel)
if err != nil {
panic(err)
}
lcfg := logging.Config{
DisplayLevel: logging.Info,
DisplayLevel: lvl,
// this will result in no written logs, just stdout
// to enable log files, a logDir param should be added and
// accordingly possibly a flag
LogLevel: logging.Off,
}
logFactory := logging.NewFactory(lcfg)
var err error
log, err = logFactory.Make(constants.LogNameControl)
if err != nil {
panic(err)
Expand Down
8 changes: 6 additions & 2 deletions cmd/ping/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ func NewCommand() *cobra.Command {
}

func pingFunc(cmd *cobra.Command, args []string) error {
lvl, err := logging.ToLevel(logLevel)
if err != nil {
return err
}
lcfg := logging.Config{
DisplayLevel: logging.Info,
DisplayLevel: lvl,
LogLevel: logging.Off,
}
logFactory := logging.NewFactory(lcfg)
var err error
log, err := logFactory.Make(constants.LogNameControl)
if err != nil {
return err
Expand Down
2 changes: 1 addition & 1 deletion tests/e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func init() {
flag.StringVar(
&logDir,
"log-dir",
logging.Info.String(),
"",
"log directory",
)
flag.StringVar(
Expand Down

0 comments on commit 11b925f

Please sign in to comment.