Skip to content

Commit

Permalink
fix RUST_LOG overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
erhant committed Dec 26, 2024
1 parent 94819f5 commit c0a2d70
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,14 +233,16 @@ func main() {
envvars["SERPER_API_KEY"] = utils.GetUserInput("Enter your Serper API key (optional, just press enter for skipping it)", true)
}

// log level
if *dev {
envvars["RUST_LOG"] = "none,dkn_compute=debug,dkn_p2p=debug,dkn_workflows=debug,ollama_workflows=info"
} else if *trace {
envvars["RUST_LOG"] = "none,dkn_compute=trace,dkn_p2p=trace,dkn_workflows=trace"
} else {
// default level info
envvars["RUST_LOG"] = "none,dkn_compute=info,dkn_p2p=info,dkn_workflows=info"
// set log level if RUST_LOG is not set
if _, exists := envvars["RUST_LOG"]; !exists {
if *dev {
envvars["RUST_LOG"] = "none,dkn_compute=debug,dkn_p2p=debug,dkn_workflows=debug,ollama_workflows=info"
} else if *trace {
envvars["RUST_LOG"] = "none,dkn_compute=trace,dkn_p2p=trace,dkn_workflows=trace"
} else {
// default level info
envvars["RUST_LOG"] = "none,dkn_compute=info,dkn_p2p=info,dkn_workflows=info"
}
}

// get latest dkn_compute binary version
Expand Down

0 comments on commit c0a2d70

Please sign in to comment.