aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiall Sheridan <nsheridan@gmail.com>2017-01-24 23:51:23 +0000
committerNiall Sheridan <nsheridan@gmail.com>2017-01-24 23:51:23 +0000
commit0f4344348419ed6c3ee4236188e456d79e2d51b4 (patch)
treee7a5d302f2bb4be6922d19c8891b64076c38f784
parent51cc4c07b2a2b6345b1496baac865f5faf955e7d (diff)
Log the datastore warning as a single line
-rw-r--r--server/config/config.go15
1 files changed, 9 insertions, 6 deletions
diff --git a/server/config/config.go b/server/config/config.go
index f2598a0..eec6d73 100644
--- a/server/config/config.go
+++ b/server/config/config.go
@@ -1,6 +1,7 @@
package config
import (
+ "bytes"
"fmt"
"io"
"log"
@@ -111,20 +112,22 @@ func convertDatastoreConfig(c *Config) {
case "mem":
c.Server.Database = map[string]string{"type": "mem"}
}
- log.Println("The `datastore` option has been deprecated in favour of the `database` option. You should update your config.")
- log.Println("The new config (passwords have been redacted) should look something like:")
- fmt.Printf("server {\n database {\n")
+ var out bytes.Buffer
+ out.WriteString("The `datastore` option has been deprecated in favour of the `database` option. You should update your config.\n")
+ out.WriteString("The new config (passwords have been redacted) should look something like:\n")
+ out.WriteString("server {\n database {\n")
for k, v := range c.Server.Database {
if v == "" {
continue
}
if k == "password" {
- fmt.Printf(" password = \"[ REDACTED ]\"\n")
+ out.WriteString(" password = \"[ REDACTED ]\"\n")
continue
}
- fmt.Printf(" %s = \"%s\"\n", k, v)
+ out.WriteString(fmt.Sprintf(" %s = \"%s\"\n", k, v))
}
- fmt.Printf(" }\n}\n")
+ out.WriteString(" }\n}")
+ log.Println(out.String())
}
}