Skip to content

Commit

Permalink
Merge pull request #110 from SiaFoundation/nate/fix-log-path
Browse files Browse the repository at this point in the history
Fix log path
  • Loading branch information
n8maninger committed Jul 13, 2023
2 parents b99d698 + 09cbd1b commit 8586fb8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bin/
.DS_Store
.vscode
.vscode
hostd.yml
11 changes: 7 additions & 4 deletions cmd/hostd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,6 @@ func main() {
// attempt to load the config file first, command line flags will override
// any values set in the config file
mustLoadConfig()
// set the log path to the data dir if it is not already set
if len(config.Log.Path) == 0 {
config.Log.Path = config.DataDir
}

// global
flag.StringVar(&config.Name, "name", config.Name, "a friendly name for the host, only used for display")
Expand Down Expand Up @@ -215,6 +211,13 @@ func main() {
mustSetAPIPassword()
mustSetWalletkey()

// set the log path to the data dir if it is not already set note: this
// musst happen after CLI flags are parsed so that the data directory can be
// specified via the command line
if len(config.Log.Path) == 0 {
config.Log.Path = config.DataDir
}

var seed [32]byte
if err := wallet.SeedFromPhrase(&seed, config.RecoveryPhrase); err != nil {
log.Fatalln("failed to load wallet:", err)
Expand Down

0 comments on commit 8586fb8

Please sign in to comment.