Skip to content

Commit 4d2be40

Browse files
committed
chore: change config file log line to debug
1 parent fb07b08 commit 4d2be40

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

cmd/ipswd/cmd/root.go

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ THE SOFTWARE.
2222
package cmd
2323

2424
import (
25-
"fmt"
2625
"os"
2726
"path/filepath"
2827
"strings"
@@ -82,6 +81,6 @@ func initConfig() {
8281

8382
// If a config file is found, read it in.
8483
if err := viper.ReadInConfig(); err == nil {
85-
fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed())
84+
log.WithField("config", viper.ConfigFileUsed()).Debug("using config file")
8685
}
8786
}

config.example.yml

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ daemon:
55
port: 3993
66
# socket: /tmp/ipsw.sock
77
debug: false
8+
# logfile: /var/log/ipswd.log
9+
database:
10+
# driver: sqlite3
11+
# dsn: /var/lib/ipswd/ipswd.db
812
# The lines beneath this are called `modelines`. See `:help modeline`
913
# Feel free to remove those if you don't want/use them.
1014
# yaml-language-server: $schema=https://blacktop.github.io/ipsw/static/schema.json

internal/daemon/daemon.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ func (d *daemon) Start() (err error) {
3636
gin.SetMode(gin.ReleaseMode)
3737
}
3838
d.server = server.NewServer(&server.Config{
39-
Host: d.conf.Daemon.Host,
40-
Port: d.conf.Daemon.Port,
41-
Socket: d.conf.Daemon.Socket,
42-
Debug: d.conf.Daemon.Debug,
39+
Host: d.conf.Daemon.Host,
40+
Port: d.conf.Daemon.Port,
41+
Socket: d.conf.Daemon.Socket,
42+
Debug: d.conf.Daemon.Debug,
43+
LogFile: d.conf.Daemon.LogFile,
4344
})
4445
return d.server.Start()
4546
}

0 commit comments

Comments
 (0)