summaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/main.go b/main.go
index 0f9331f..d18e7dc 100644
--- a/main.go
+++ b/main.go
@@ -41,14 +41,15 @@ func main() {
}
cfg := app.DefaultConfig()
+ log.Infof("Reading configuration from %s", config)
err := cfg.ReadFile(config)
- if err == nil {
- log.Infof("reading configuration from %s", config)
- } else {
- if !os.IsNotExist(err) {
+ if err != nil {
+ if flag.Lookup("config").Changed {
log.Fatal(err)
}
+ log.Infof("Reading %s failed. Starting with builtin defaults.", config)
}
+ // I'd like to add something like this here: log.Debug("Active config: %s", cfg.toJson())
a, err := app.NewApp(cfg)
if err != nil {
log.Fatal(err)