summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/api/flags.go11
-rw-r--r--cmd/api/main.go9
2 files changed, 7 insertions, 13 deletions
diff --git a/cmd/api/flags.go b/cmd/api/flags.go
index 9cdf9ec..4d967fd 100644
--- a/cmd/api/flags.go
+++ b/cmd/api/flags.go
@@ -3,9 +3,10 @@ package main
import "flag"
var (
- cluster = flag.String("cluster", "", "Master node address (ex: 192.168.1.10:5657)")
- clusterID = flag.String("cluster_id", "", "Cluster id")
- clusterAddr = flag.String("cluster_addr", ":5657", "Self address for cluster")
- apiAddr = flag.String("api_addr", ":5656", "API address")
- dbPath = flag.String("db_path", "/var/djson.db", "DB file")
+ // cluster = flag.String("cluster", "", "Master node address (ex: 192.168.1.10:5657)")
+ // clusterID = flag.String("cluster_id", "", "Cluster id")
+ // clusterAddr = flag.String("cluster_addr", ":5657", "Self address for cluster")
+ apiAddr = flag.String("api_addr", ":5656", "API address")
+ dbPath = flag.String("db_path", "/var/djson.db", "DB file")
+ logLevel = flag.String("log_level", "info", "Log level")
)
diff --git a/cmd/api/main.go b/cmd/api/main.go
index 51e16af..3d2f587 100644
--- a/cmd/api/main.go
+++ b/cmd/api/main.go
@@ -27,7 +27,7 @@ func main() {
logger := httplog.NewLogger("djson", httplog.Options{
JSON: true,
- LogLevel: "debug",
+ LogLevel: *logLevel,
})
// Tree storage
@@ -45,13 +45,6 @@ func main() {
panic(err)
}
- // TBD raft cluster initialization
- if cluster != nil {
- logger.Info().Str("cluster connect", *cluster).Send()
- } else {
- logger.Info().Str("cluster create", *clusterAddr).Send()
- }
-
// Tree HTTP wrapper
treeHandler := handler.New(core, eventsDispatcher)