Skip to content

Commit

Permalink
simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
steezeburger committed Mar 29, 2024
1 parent d7b1473 commit 60a380d
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions cmd/logging.go
Original file line number Diff line number Diff line change
@@ -1,28 +1,15 @@
package cmd

import (
"fmt"

log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)

var debug bool

type PlainFormatter struct {
}

func (f *PlainFormatter) Format(entry *log.Entry) ([]byte, error) {
return []byte(fmt.Sprintf("%s\n", entry.Message)), nil
}

// ToggleDebug toggles debug logging on or off.
func ToggleDebug(cmd *cobra.Command, args []string) {
if debug {
log.SetLevel(log.DebugLevel)
log.SetFormatter(&log.TextFormatter{})
} else {
plainFormatter := new(PlainFormatter)
log.SetFormatter(plainFormatter)
}
}

0 comments on commit 60a380d

Please sign in to comment.