Skip to content

Commit

Permalink
Turn logger tracing on with debug flags at appropriate level
Browse files Browse the repository at this point in the history
  • Loading branch information
rcowham committed Jun 11, 2024
1 parent 1a04267 commit f60acef
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmd/p4dpending/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"sync"
"time"

"github.com/pkg/profile"
"gopkg.in/alecthomas/kingpin.v2"

"github.com/machinebox/progress"
Expand Down Expand Up @@ -243,10 +242,10 @@ func main() {
kingpin.HelpFlag.Short('h')
kingpin.Parse()

if *debug > 0 {
// CPU profiling by default
defer profile.Start().Stop()
}
// if *debug > 0 {
// // CPU profiling by default
// // defer profile.Start().Stop()
// }
logger := logrus.New()
logger.Level = logrus.InfoLevel
if *debug > 0 {
Expand Down Expand Up @@ -288,6 +287,9 @@ func main() {
if *debug > 0 {
fp.SetDebugMode(*debug)
}
if *debug >= int(p4dlog.DebugCommands) {
logger.Level = logrus.TraceLevel
}
if *debugPID != 0 && *debugCmd != "" {
fp.SetDebugPID(*debugPID, *debugCmd)
}
Expand Down

0 comments on commit f60acef

Please sign in to comment.