printing config key list

This commit is contained in:
Kyle Isom 2023-05-06 01:27:50 -07:00
parent 1ed2ddeca5
commit 225399690e
1 changed files with 6 additions and 3 deletions

View File

@ -2,7 +2,6 @@ package main
import ( import (
"flag" "flag"
"fmt"
"path/filepath" "path/filepath"
"time" "time"
@ -91,7 +90,7 @@ func main() {
flag.StringVar(&configFile, "f", defaultPath("nlink.conf"), "`path` to config file") flag.StringVar(&configFile, "f", defaultPath("nlink.conf"), "`path` to config file")
flag.BoolVar(&initDB, "i", false, "initialize a new DB") flag.BoolVar(&initDB, "i", false, "initialize a new DB")
flag.StringVar(&level, "l", "INFO", "log level") flag.StringVar(&level, "l", "DEBUG", "log level")
flag.BoolVar(&markOnly, "m", false, "only mark posts as having been posted") flag.BoolVar(&markOnly, "m", false, "only mark posts as having been posted")
flag.Parse() flag.Parse()
@ -101,12 +100,16 @@ func main() {
Facility: "daemon", Facility: "daemon",
WriteSyslog: false, WriteSyslog: false,
} }
fmt.Println(defaultPath("nlink.conf"))
if err := log.Setup(logOpts); err != nil { if err := log.Setup(logOpts); err != nil {
die.If(err) die.If(err)
} }
log.Debugln("config keys")
for _, k := range config.ListKeys() {
log.Debugf("key: %s", k)
}
log.Infof("minio_bucket: %s", config.Get("minio_bucket")) log.Infof("minio_bucket: %s", config.Get("minio_bucket"))
if err := restoreDatabase(config.Get("local_database")); err != nil { if err := restoreDatabase(config.Get("local_database")); err != nil {
log.Fatal(err) log.Fatal(err)