From 4d2be40ba91dea7956b8de5c67c063deee1b9f1c Mon Sep 17 00:00:00 2001 From: blacktop Date: Thu, 13 Apr 2023 16:27:42 -0600 Subject: [PATCH] chore: change config file log line to debug --- cmd/ipswd/cmd/root.go | 3 +-- config.example.yml | 4 ++++ internal/daemon/daemon.go | 9 +++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/cmd/ipswd/cmd/root.go b/cmd/ipswd/cmd/root.go index 28379dfc84..ce0a324599 100644 --- a/cmd/ipswd/cmd/root.go +++ b/cmd/ipswd/cmd/root.go @@ -22,7 +22,6 @@ THE SOFTWARE. package cmd import ( - "fmt" "os" "path/filepath" "strings" @@ -82,6 +81,6 @@ func initConfig() { // If a config file is found, read it in. if err := viper.ReadInConfig(); err == nil { - fmt.Fprintln(os.Stderr, "Using config file:", viper.ConfigFileUsed()) + log.WithField("config", viper.ConfigFileUsed()).Debug("using config file") } } diff --git a/config.example.yml b/config.example.yml index cb1d4a8901..1d148002af 100644 --- a/config.example.yml +++ b/config.example.yml @@ -5,6 +5,10 @@ daemon: port: 3993 # socket: /tmp/ipsw.sock debug: false + # logfile: /var/log/ipswd.log +database: + # driver: sqlite3 + # dsn: /var/lib/ipswd/ipswd.db # The lines beneath this are called `modelines`. See `:help modeline` # Feel free to remove those if you don't want/use them. # yaml-language-server: $schema=https://blacktop.github.io/ipsw/static/schema.json diff --git a/internal/daemon/daemon.go b/internal/daemon/daemon.go index 2f44fc64ef..ddfba07a2b 100644 --- a/internal/daemon/daemon.go +++ b/internal/daemon/daemon.go @@ -36,10 +36,11 @@ func (d *daemon) Start() (err error) { gin.SetMode(gin.ReleaseMode) } d.server = server.NewServer(&server.Config{ - Host: d.conf.Daemon.Host, - Port: d.conf.Daemon.Port, - Socket: d.conf.Daemon.Socket, - Debug: d.conf.Daemon.Debug, + Host: d.conf.Daemon.Host, + Port: d.conf.Daemon.Port, + Socket: d.conf.Daemon.Socket, + Debug: d.conf.Daemon.Debug, + LogFile: d.conf.Daemon.LogFile, }) return d.server.Start() }