package applicationConfig import ( "flag" "sirlab.de/go/knowyt/log" ) type ApplicationConfig struct { DataDir string BindString string } func NewApplicationConfig() ApplicationConfig { flagVerbosePtr := flag.Bool("v", false, "log debug messages, too") flagQuietPtr := flag.Bool("q", false, "be quiet; warning and error messages only") bindStringPtr := flag.String("b", ":32039", "interface and port to bind to") flag.Parse() log.SetLoglevel(log.LOG_INFO) if *flagVerbosePtr { log.SetLoglevel(log.LOG_DEBUG) } if *flagQuietPtr { log.SetLoglevel(log.LOG_WARN) } return ApplicationConfig{ DataDir: "data/", BindString: *bindStringPtr, } }